STK++ 0.9.13
STK::ICArray< Derived > Class Template Reference

s More...

#include <STK_ICArray.h>

Inheritance diagram for STK::ICArray< Derived >:
Inheritance graph

Public Types

enum  {
  structure_ = hidden::Traits< Derived >::structure_ , orient_ = hidden::Traits< Derived >::orient_ , sizeRows_ = hidden::Traits< Derived >::sizeRows_ , sizeCols_ = hidden::Traits< Derived >::sizeCols_ ,
  storage_ = hidden::Traits< Derived >::storage_
}
 
typedef ArrayBase< Derived > Base
 
typedef hidden::Traits< Derived >::Allocator Allocator
 
typedef hidden::Traits< Derived >::Row Row
 
typedef hidden::Traits< Derived >::Col Col
 
typedef hidden::Traits< Derived >::Type Type
 
typedef hidden::Traits< Derived >::TypeConst TypeConst
 
typedef TRange< sizeRows_RowRange
 Type of the Range for the rows.
 
typedef TRange< sizeCols_ColRange
 Type of the Range for the columns.
 
- Public Types inherited from STK::ArrayBase< Derived >
enum  {
  structure_ = hidden::Traits<Derived>::structure_ , orient_ = hidden::Traits<Derived>::orient_ , sizeRows_ = hidden::Traits<Derived>::sizeRows_ , sizeCols_ = hidden::Traits<Derived>::sizeCols_ ,
  storage_ = hidden::Traits<Derived>::storage_
}
 
typedef ExprBase< Derived > Base
 
typedef hidden::Traits< Derived >::Type Type
 
typedef hidden::Traits< Derived >::TypeConst TypeConst
 
- Public Types inherited from STK::ExprBase< Derived >
enum  {
  structure_ = hidden::Traits<Derived>::structure_ , orient_ = hidden::Traits<Derived>::orient_ , sizeRows_ = hidden::Traits<Derived>::sizeRows_ , sizeCols_ = hidden::Traits<Derived>::sizeCols_ ,
  storage_ = hidden::Traits<Derived>::storage_
}
 
typedef ITContainer< Derived, structure_Base
 
typedef hidden::Traits< Derived >::Type Type
 
typedef hidden::Traits< Derived >::TypeConst TypeConst
 

Public Member Functions

ColRange constcolsImpl () const
 
RowRange constrowsImpl () const
 
void clear ()
 clear all allocated memory .
 
bool empty () const
 
bool isRef () const
 
Allocator constallocator () const
 Get a constant reference on the main allocator.
 
Type *constp_data () const
 
Typeelt2Impl (int i, int j)
 implement the const element accessor
 
TypeConst elt2Impl (int i, int j) const
 implement the writable element accessor
 
Typeelt1Impl (int j)
 implement the const element accessor for vector/point/diagonal arrays
 
TypeConst elt1Impl (int j) const
 implement the writable element accessor for vector/point/diagonal arrays
 
Typeelt0Impl ()
 implement the const element accessor for number arrays
 
TypeConst elt0Impl () const
 implement the writable element accessor for number arrays
 
void setValueImpl (int j, TypeConst value)
 implement setValue for vector/point/diagonal arrays
 
void setValueImpl (int i, int j, TypeConst value)
 implement setValue for vector/point/diagonal arrays
 
Typeoperator() (int i, int j)
 
TypeConst operator() (int i, int j) const
 
Typeoperator[] (int i)
 
TypeConst operator[] (int i) const
 
Typeoperator() ()
 
TypeConst operator() () const
 
hidden::CSlice< Derived, 1, sizeCols_ >::Result row (int i) const
 implement the row operator using a reference on the row of the allocator
 
template<int Size_>
hidden::CSlice< Derived, 1, Size_ >::Result row (int i, TRange< Size_ > const &J) const
 implement the row operator using a reference on the row of the allocator
 
template<int Size_>
hidden::CSlice< Derived, 1, Size_ >::Result operator() (int i, TRange< Size_ > const &J) const
 
template<int Size_>
hidden::CSlice< Derived, Size_, sizeCols_ >::Result row (TRange< Size_ > const &I) const
 implement the row operator using a reference on a range of rows of the allocator
 
hidden::CSlice< Derived, sizeRows_, 1 >::Result col (int j) const
 implement the col operator using a reference on the column of the allocator
 
template<int Size_>
hidden::CSlice< Derived, Size_, 1 >::Result col (TRange< Size_ > const &I, int j) const
 implement the col operator using a reference on the column of the allocator
 
template<int Size_>
hidden::CSlice< Derived, sizeRows_, Size_ >::Result col (TRange< Size_ > const &J) const
 implement the col operator using a reference on a range of columns of the allocator
 
template<int Size_>
hidden::CSlice< Derived, Size_, 1 >::Result operator() (TRange< Size_ > const &I, int j) const
 
template<int Size>
hidden::CSliceDispatcher< Derived, Size >::Result sub (TRange< Size > const &J) const
 implement the sub operator for 1D arrays using a reference on the row/column of the allocator
 
template<int Size>
hidden::CSliceDispatcher< Derived, Size >::Result operator[] (TRange< Size > const &I) const
 
template<int OtherRows_, int OtherCols_>
hidden::CSlice< Derived, OtherRows_, OtherCols_ >::Result sub (TRange< OtherRows_ > const &I, TRange< OtherCols_ > const &J) const
 implement the sub operator for 2D arrays using references on a range of rows and columns of the allocator
 
template<int OtherRows_, int OtherCols_>
hidden::CSlice< Derived, OtherRows_, OtherCols_ >::Result operator() (TRange< OtherRows_ > const &I, TRange< OtherCols_ > const &J) const
 
void swap (int i, int j)
 swap two elements: only for vectors an points.
 
void swapCols (int pos1, int pos2)
 
void swapRows (int pos1, int pos2)
 
void exchange (Derived &T)
 exchange this with T.
 
void move (Derived const &T)
 move T to this.
 
Derived & shift (int beginRows, int beginCols)
 shift the Array.
 
Derived & shift (int firstIdx)
 shift the Array.
 
Derived & resize (Range const &I, Range const &J)
 resize the Array.
 
template<int Size_>
Derived & resize (TRange< Size_ > const &I)
 Resize the vector/point/diagonal/square array.
 
Derived & resize (int size)
 Resize the vector/point/diagonal/square array.
 
- Public Member Functions inherited from STK::ArrayBase< Derived >
template<typename Visitor >
void apply (Visitor &visitor)
 Apply the Visitor visitor to the whole coefficients of the array.
 
Derived & randUnif ()
 set random values to this using a uniform law.
 
Derived & randGauss ()
 set random values to this using a standard gaussian law.
 
Derived & rand (Law::IUnivLaw< Type > const &law)
 set random values to this using a distribution law given by the user.
 
Derived & setOnes ()
 set one to this using a Visitor.
 
Derived & setZeros ()
 set zero to this using a Visitor.
 
Derived & ones ()
 set one to this using a Visitor.
 
Derived & zeros ()
 set zero to this using a Visitor.
 
Derived & setValue (TypeConst value)
 set a value to this container.
 
void setValue (int i, TypeConst value)
 set a value to this container at index i.
 
void setValue (int i, int j, TypeConst value)
 set a value to this container at position (i,j).
 
template<class Rhs >
Derived & assign (ExprBase< Rhs > const &rhs)
 
Derived & operator= (Type const &value)
 
Derived & operator= (Derived const &rhs)
 
template<typename Rhs >
Derived & operator= (ExprBase< Rhs > const &rhs)
 
template<typename Rhs >
Derived & operator+= (ExprBase< Rhs > const &other)
 Add Rhs to this.
 
template<typename Rhs >
Derived & operator-= (ExprBase< Rhs > const &other)
 subtract a Rhs to this.
 
template<typename Rhs >
Derived & operator/= (ExprBase< Rhs > const &other)
 divide this by Rhs.
 
template<typename Rhs >
Derived & operator%= (ExprBase< Rhs > const &other)
 Take modulo of this by Rhs.
 
template<typename Rhs >
Derived & operator*= (ExprBase< Rhs > const &other)
 multiply this by Rhs.
 
Derived & operator+= (Type const &other)
 Adding a constant to this.
 
Derived & operator-= (Type const &other)
 Subtract a constant to this.
 
Derived & operator*= (Type const &other)
 product of this by a constant.
 
Derived & operator/= (Type const &other)
 dividing this by a constant.
 
Derived & operator%= (Type const &other)
 take modulo of this by a constant.
 
template<class Rhs >
Derived & copy (ExprBase< Rhs > const &rhs)
 overwrite this with src.
 
TransposeOperator< Derived > const transpose () const
 
TransposeAccessor< Derived > transpose ()
 
DiagonalizeOperator< Derived > const diagonalize () const
 
DiagonalizeAccessor< Derived > diagonalize ()
 
DiagonalGetterOperator< Derived > const getDiagonal () const
 
DiagonalGetterAccessor< Derived > getDiagonal ()
 
UpperTriangularizeOperator< Derived > const upperTriangularize () const
 
UpperTriangularizeAccessor< Derived > upperTriangularize ()
 
LowerTriangularizeOperator< Derived > const lowerTriangularize () const
 
LowerTriangularizeAccessor< Derived > lowerTriangularize ()
 
SymmetrizeOperator< Derived > const symmetrize () const
 
SymmetrizeAccessor< Derived > symmetrize ()
 
UpperSymmetrizeOperator< Derived > const upperSymmetrize () const
 
UpperSymmetrizeAccessor< Derived > upperSymmetrize ()
 
LowerSymmetrizeOperator< Derived > const lowerSymmetrize () const
 
LowerSymmetrizeAccessor< Derived > lowerSymmetrize ()
 
ColOperator< Derived > const col (int j) const
 
RowOperator< Derived > const row (int i) const
 
template<int Size_>
SubVectorOperator< Derived, Size_ > const sub (TRange< Size_ > const &I) const
 
template<int SizeRows_, int SizeCols_>
SubOperator< Derived, SizeRows_, SizeCols_ > const sub (TRange< SizeRows_ > const &I, TRange< SizeCols_ > const &J) const
 
ColAccessor< Derived > col (int j)
 
RowAccessor< Derived > row (int i)
 
template<int Size_>
SubVectorAccessor< Derived, Size_sub (TRange< Size_ > const &I)
 
template<int SizeRows_, int SizeCols_>
SubAccessor< Derived, SizeRows_, SizeCols_sub (TRange< SizeRows_ > const &I, TRange< SizeCols_ > const &J)
 
TypeConst operator() (int i, int j) const
 
Typeoperator() (int i, int j)
 
TypeConst operator[] (int i) const
 
Typeoperator[] (int i)
 
TypeConst operator() () const
 
Typeoperator() ()
 
ArrayInitializer< Derived > operator<< (Type const &s)
 Convenient operator to set the coefficients of a matrix.
 
template<typename Rhs >
ArrayInitializer< Derived > operator<< (ArrayBase< Rhs > const &other)
 
- Public Member Functions inherited from STK::ExprBase< Derived >
template<typename Visitor >
Visitor::TypeConst visit (Visitor &visitor) const
 Visit the container using a constant visitor.
 
int count () const
 compute the value of non-zero element in an expression.
 
bool const any () const
 check if there is any non-zero element in an expression.
 
bool const all () const
 check if all the elements in an expression are not zero.
 
int nbAvailableValues () const
 
Type const minElt (int &row, int &col) const
 
Type const minEltSafe (int &row, int &col) const
 
Type const maxElt (int &row, int &col) const
 
Type const maxEltSafe (int &row, int &col) const
 
Type const minElt (int &pos) const
 
Type const minEltSafe (int &pos) const
 
Type const maxElt (int &pos) const
 
Type const maxEltSafe (int &pos) const
 
Type const minElt () const
 
Type const minEltSafe () const
 
Type const maxElt () const
 
Type const maxEltSafe () const
 
Type const sum () const
 
Type const sumSafe () const
 
Type const norm () const
 
Type const normSafe () const
 
Type const norm2 () const
 
Type const norm2Safe () const
 
Type const normInf () const
 
Type const mean () const
 
Type const meanSafe () const
 
Type const variance () const
 
Type const varianceSafe () const
 
Type const variance (Type const &mean) const
 
Type const varianceSafe (Type const &mean) const
 
template<typename Rhs >
Type const wsum (ExprBase< Rhs > const &weights) const
 
template<typename Rhs >
Type const wsumSafe (ExprBase< Rhs > const &weights) const
 
template<typename Rhs >
Type const wnorm (ExprBase< Rhs > const &weights) const
 
template<typename Rhs >
Type const wnormSafe (ExprBase< Rhs > const &weights) const
 
template<typename Rhs >
Type const wnorm2 (ExprBase< Rhs > const &weights) const
 
template<typename Rhs >
Type const wnorm2Safe (ExprBase< Rhs > const &weights) const
 
template<typename Rhs >
Type const wmean (ExprBase< Rhs > const &weights) const
 
template<typename Rhs >
Type const wmeanSafe (ExprBase< Rhs > const &weights) const
 
template<typename Rhs >
Type const wvariance (ExprBase< Rhs > const &weights) const
 
template<typename Rhs >
Type const wvarianceSafe (ExprBase< Rhs > const &weights) const
 
template<typename Rhs >
Type const wvariance (Type const &mean, ExprBase< Rhs > const &weights) const
 
template<typename Rhs >
Type const wvarianceSafe (Type const &mean, ExprBase< Rhs > const &weights) const
 
template<typename Rhs >
hidden::OperatorSelector< Derived, Rhs, Arrays::equalOp_ >::Result const operator== (ExprBase< Rhs > const &other) const
 
template<typename Rhs >
hidden::OperatorSelector< Derived, Rhs, Arrays::notEqualOp_ >::Result const operator!= (ExprBase< Rhs > const &other) const
 
template<typename Rhs >
hidden::OperatorSelector< Derived, Rhs, Arrays::greaterThanOp_ >::Result const operator> (ExprBase< Rhs > const &other) const
 
template<typename Rhs >
hidden::OperatorSelector< Derived, Rhs, Arrays::lessThanOp_ >::Result const operator< (ExprBase< Rhs > const &other) const
 
template<typename Rhs >
hidden::OperatorSelector< Derived, Rhs, Arrays::greaterThanOrEqualOp_ >::Result const operator>= (ExprBase< Rhs > const &other) const
 
template<typename Rhs >
hidden::OperatorSelector< Derived, Rhs, Arrays::lessThanOrEqualOp_ >::Result const operator<= (ExprBase< Rhs > const &other) const
 
template<typename Rhs >
hidden::OperatorSelector< Derived, Rhs, Arrays::sumOp_ >::Result const operator+ (ExprBase< Rhs > const &other) const
 
template<typename Rhs >
hidden::OperatorSelector< Derived, Rhs, Arrays::differenceOp_ >::Result const operator- (ExprBase< Rhs > const &other) const
 
template<typename Rhs >
hidden::OperatorSelector< Derived, Rhs, Arrays::productOp_ >::Result const prod (ExprBase< Rhs > const &other) const
 
template<typename Rhs >
hidden::OperatorSelector< Derived, Rhs, Arrays::divisionOp_ >::Result const operator/ (ExprBase< Rhs > const &other) const
 
template<typename Rhs >
hidden::OperatorSelector< Derived, Rhs, Arrays::moduloOp_ >::Result const operator% (ExprBase< Rhs > const &other) const
 
template<typename Rhs >
hidden::OperatorSelector< Derived, Rhs, Arrays::minOp_ >::Result const min (ExprBase< Rhs > const &other) const
 
template<typename Rhs >
hidden::OperatorSelector< Derived, Rhs, Arrays::maxOp_ >::Result const max (ExprBase< Rhs > const &other) const
 
template<typename Rhs >
hidden::OperatorSelector< Derived, Rhs, Arrays::logicalAndOp_ >::Result const operator&& (ExprBase< Rhs > const &other) const
 
template<typename Rhs >
hidden::OperatorSelector< Derived, Rhs, Arrays::logicalOrOp_ >::Result const operator|| (ExprBase< Rhs > const &other) const
 
template<typename Rhs >
hidden::OperatorSelector< Derived, Rhs, Arrays::bitwiseAndOp_ >::Result const operator& (ExprBase< Rhs > const &other) const
 
template<typename Rhs >
hidden::OperatorSelector< Derived, Rhs, Arrays::bitwiseOrOp_ >::Result const operator| (ExprBase< Rhs > const &other) const
 
template<typename Rhs >
hidden::OperatorSelector< Derived, Rhs, Arrays::bitwiseXorOp_ >::Result const operator^ (ExprBase< Rhs > const &other) const
 
UnaryOperator< OppositeOp< Type >, Derived > operator- () const
 
UnaryOperator< IsNaOp< Type >, Derived > isNA () const
 
UnaryOperator< NegOp< Type >, Derived > neg () const
 
UnaryOperator< IsFiniteOp< Type >, Derived > isFinite () const
 
UnaryOperator< IsInfiniteOp< Type >, Derived > isInfinite () const
 
UnaryOperator< AbsOp< Type >, Derived > abs () const
 
UnaryOperator< ExpOp< Type >, Derived > exp () const
 
UnaryOperator< LogOp< Type >, Derived > log () const
 
UnaryOperator< SqrtOp< Type >, Derived > sqrt () const
 
UnaryOperator< CosOp< Type >, Derived > cos () const
 
UnaryOperator< SinOp< Type >, Derived > sin () const
 
UnaryOperator< AcosOp< Type >, Derived > acos () const
 
UnaryOperator< AsinOp< Type >, Derived > asin () const
 
UnaryOperator< TanOp< Type >, Derived > tan () const
 
UnaryOperator< InverseOp< Type >, Derived > inverse () const
 
UnaryOperator< SquareOp< Type >, Derived > square () const
 
UnaryOperator< CubeOp< Type >, Derived > cube () const
 
UnaryOperator< EqualWithOp< Type >, Derived > operator== (Type const &value) const
 
UnaryOperator< NotEqualWithOp< Type >, Derived > operator!= (Type const &value) const
 
UnaryOperator< GreaterThanOp< Type >, Derived > operator> (Type const &value) const
 
UnaryOperator< LessThanOp< Type >, Derived > operator< (Type const &value) const
 
UnaryOperator< LeqThanOp< Type >, Derived > operator<= (Type const &value) const
 
UnaryOperator< GeqThanOp< Type >, Derived > operator>= (Type const &value) const
 
UnaryOperator< MinWithOp< Type >, Derived > min (Type const &value) const
 
UnaryOperator< MaxWithOp< Type >, Derived > max (Type const &value) const
 
UnaryOperator< SumWithOp< Type >, Derived > operator+ (Type const &value) const
 
UnaryOperator< DifferenceWithOp< Type >, Derived > operator- (Type const &value) const
 
UnaryOperator< ProductWithOp< Type >, Derived > operator* (Type const &value) const
 
UnaryOperator< DivisionWithOp< Type >, Derived > operator/ (Type const &value) const
 
UnaryOperator< ModuloWithOp< Type >, Derived > operator% (Type const &value) const
 
UnaryOperator< LogicalAndWithOp< Type >, Derived > operator&& (Type const &value) const
 
UnaryOperator< LogicalOrWithOp< Type >, Derived > operator|| (Type const &value) const
 
UnaryOperator< BitwiseAndWithOp< Type >, Derived > operator& (Type const &value) const
 
UnaryOperator< BitwiseOrWithOp< Type >, Derived > operator| (Type const &value) const
 
UnaryOperator< BitwiseXorWithOp< Type >, Derived > operator^ (Type const &value) const
 
UnaryOperator< PowOp< Type >, Derived > pow (Type const &value) const
 
UnaryOperator< SafeInverseOp< Type >, Derived > safeInverse (Type const &value) const
 
UnaryOperator< SafeOp< Type >, Derived > const safe (Type const value=Type()) const
 
template<typename OtherType >
UnaryOperator< CastOp< Type, OtherType >, Derived > const cast () const
 
UnaryOperator< Law::PdfOp< Type >, Derived > pdf (Law::IUnivLaw< Type > const &law) const
 compute pdf values to this using distribution law given by user
 
UnaryOperator< Law::LogPdfOp< Type >, Derived > lpdf (Law::IUnivLaw< Type > const &law) const
 compute log-pdf values to this using distribution law given by user
 
UnaryOperator< Law::CdfOp< Type >, Derived > cdf (Law::IUnivLaw< Type > const &law) const
 compute cumulative distribution function of this using distribution law given by user
 
UnaryOperator< Law::LogCdfOp< Type >, Derived > lcdf (Law::IUnivLaw< Type > const &law) const
 compute log-cumulative distribution function of this using distribution law given by user
 
UnaryOperator< Law::CdfcOp< Type >, Derived > cdfc (Law::IUnivLaw< Type > const &law) const
 compute complementary cumulative distribution function of this using distribution law given by user
 
UnaryOperator< Law::LogCdfcOp< Type >, Derived > lcdfc (Law::IUnivLaw< Type > const &law) const
 compute complementary cumulative distribution function of this using distribution law given by user
 
UnaryOperator< Law::IcdfOp< Type >, Derived > icdf (Law::IUnivLaw< Type > const &law) const
 compute inverse cumulative distribution function using distribution law given by user
 
template<template< typename > class OtherOperator>
UnaryOperator< OtherOperator< Type >, Derived > const funct0 () const
 
template<template< typename > class OtherOperator>
UnaryOperator< OtherOperator< Type >, Derived > const funct1 (Type const value) const
 
TransposeOperator< Derived > const transpose () const
 
DiagonalizeOperator< Derived > const diagonalize () const
 
DiagonalGetterOperator< Derived > const getDiagonal () const
 
UpperTriangularizeOperator< Derived > const upperTriangularize () const
 
LowerTriangularizeOperator< Derived > const lowerTriangularize () const
 
SymmetrizeOperator< Derived > const symmetrize () const
 
UpperSymmetrizeOperator< Derived > const upperSymmetrize () const
 
LowerSymmetrizeOperator< Derived > const lowerSymmetrize () const
 
template<int Size_>
SubVectorOperator< Derived, Size_ > const sub (TRange< Size_ > const &I) const
 
ColOperator< Derived > const col (int j) const
 
RowOperator< Derived > const row (int i) const
 
template<int Size_>
SubOperator< Derived, sizeRows_, Size_ > const col (TRange< Size_ > const &J) const
 
template<int Size_>
SubOperator< Derived, Size_, sizeCols_ > const row (TRange< Size_ > const &I) const
 
template<int SizeRows_, int SizeCols_>
SubOperator< Derived, SizeRows_, SizeCols_ > const sub (TRange< SizeRows_ > const &I, TRange< SizeCols_ > const &J) const
 
template<class Rhs >
hidden::Promote< Type, typenameRhs::Type >::result_type const dot (ExprBase< Rhs > const &other) const
 
template<class Rhs >
hidden::Promote< Type, typenameRhs::Type >::result_type const dotSafe (ExprBase< Rhs > const &other) const
 
template<typename Rhs >
hidden::ProductSelector< Derived, Rhs, hidden::Traits< Derived >::structure_, hidden::Traits< Rhs >::structure_ >::ProductType const operator* (ExprBase< Rhs > const &other) const
 
template<typename Rhs >
hidden::Traits< Derived >::Type const wsum (ExprBase< Rhs > const &weights) const
 
template<typename Rhs >
hidden::Traits< Derived >::Type const wsumSafe (ExprBase< Rhs > const &weights) const
 
template<typename Rhs >
hidden::Traits< Derived >::Type const wnorm (ExprBase< Rhs > const &weights) const
 
template<typename Rhs >
hidden::Traits< Derived >::Type const wnormSafe (ExprBase< Rhs > const &weights) const
 
template<typename Rhs >
hidden::Traits< Derived >::Type const wnorm2 (ExprBase< Rhs > const &weights) const
 
template<typename Rhs >
hidden::Traits< Derived >::Type const wnorm2Safe (ExprBase< Rhs > const &weights) const
 
template<typename Rhs >
hidden::Traits< Derived >::Type const wmean (ExprBase< Rhs > const &weights) const
 
template<typename Rhs >
hidden::Traits< Derived >::Type const wmeanSafe (ExprBase< Rhs > const &weights) const
 
template<typename Rhs >
hidden::Traits< Derived >::Type const wvariance (ExprBase< Rhs > const &weights) const
 
template<typename Rhs >
hidden::Traits< Derived >::Type const wvarianceSafe (ExprBase< Rhs > const &weights) const
 
template<typename Rhs >
hidden::Traits< Derived >::Type const wvariance (Type const &mean, ExprBase< Rhs > const &weights) const
 
template<typename Rhs >
hidden::Traits< Derived >::Type const wvarianceSafe (Type const &mean, ExprBase< Rhs > const &weights) const
 

Protected Member Functions

 ICArray ()
 default constructor.
 
 ICArray (int sizeRows, int sizeCols)
 constructor with specified sizes.
 
 ICArray (int sizeRows, int sizeCols, Type const &value)
 constructor with specified sizes and value.
 
 ICArray (Derived const &T, bool ref=false)
 copy or wrapper constructor.
 
 ICArray (Type *const &q, int sizeRows, int sizeCols)
 wrapper constructor for 0 based C-Array.
 
template<class OtherAllocator >
 ICArray (ITContainer2D< OtherAllocator > const &allocator, Range const &I, Range const &J)
 constructor by reference, ref_=1.
 
template<class OtherAllocator >
 ICArray (ITContainer2D< OtherAllocator > const &allocator)
 constructor by reference, ref_=1.
 
 ~ICArray ()
 destructor
 
- Protected Member Functions inherited from STK::ArrayBase< Derived >
 ArrayBase ()
 Default constructor.
 
 ~ArrayBase ()
 destructor
 
- Protected Member Functions inherited from STK::ExprBase< Derived >
 ExprBase ()
 Default constructor.
 
 ~ExprBase ()
 destructor
 

Protected Attributes

Allocator allocator_
 allocator of the memory

 

Detailed Description

template<class Derived>
class STK::ICArray< Derived >

s

Interface class for CArray, CArrayPoint, CArrayVector, CArraySquare, CArrayNumber.

This class is the base that is inherited by all objects (matrix, vector, point) which are not expression and stored as CArrays. The common API for these objects is contained in this class.

This is essentially a wrapper of a CAllocator

Template Parameters
Derivedis the derived type, e.g., a matrix type.
See also
CAllocator, CArray, CArrayPoint, CArrayVector, CArraySquare, CArrayNumber

Definition at line 126 of file STK_ICArray.h.

Member Typedef Documentation

◆ Allocator

template<class Derived >
typedef hidden::Traits<Derived>::Allocator STK::ICArray< Derived >::Allocator

Definition at line 130 of file STK_ICArray.h.

◆ Base

template<class Derived >
typedef ArrayBase<Derived> STK::ICArray< Derived >::Base

Definition at line 129 of file STK_ICArray.h.

◆ Col

template<class Derived >
typedef hidden::Traits<Derived>::Col STK::ICArray< Derived >::Col

Definition at line 133 of file STK_ICArray.h.

◆ ColRange

template<class Derived >
typedef TRange<sizeCols_> STK::ICArray< Derived >::ColRange

Type of the Range for the columns.

Definition at line 148 of file STK_ICArray.h.

◆ Row

template<class Derived >
typedef hidden::Traits<Derived>::Row STK::ICArray< Derived >::Row

Definition at line 132 of file STK_ICArray.h.

◆ RowRange

template<class Derived >
typedef TRange<sizeRows_> STK::ICArray< Derived >::RowRange

Type of the Range for the rows.

Definition at line 146 of file STK_ICArray.h.

◆ Type

template<class Derived >
typedef hidden::Traits<Derived>::Type STK::ICArray< Derived >::Type

Definition at line 134 of file STK_ICArray.h.

◆ TypeConst

template<class Derived >
typedef hidden::Traits<Derived>::TypeConst STK::ICArray< Derived >::TypeConst

Definition at line 135 of file STK_ICArray.h.

Member Enumeration Documentation

◆ anonymous enum

template<class Derived >
anonymous enum
Enumerator
structure_ 
orient_ 
sizeRows_ 
sizeCols_ 
storage_ 

Definition at line 137 of file STK_ICArray.h.

138 {
139 structure_ = hidden::Traits< Derived >::structure_,
140 orient_ = hidden::Traits< Derived >::orient_,
141 sizeRows_ = hidden::Traits< Derived >::sizeRows_,
142 sizeCols_ = hidden::Traits< Derived >::sizeCols_,
143 storage_ = hidden::Traits< Derived >::storage_
144 };

Constructor & Destructor Documentation

◆ ICArray() [1/7]

template<class Derived >
STK::ICArray< Derived >::ICArray ( )
inlineprotected

default constructor.

Definition at line 154 of file STK_ICArray.h.

154: Base(), allocator_() {}
Allocator allocator_
allocator of the memory
ArrayBase< Derived > Base

◆ ICArray() [2/7]

template<class Derived >
STK::ICArray< Derived >::ICArray ( int  sizeRows,
int  sizeCols 
)
inlineprotected

constructor with specified sizes.

Parameters
sizeRows,sizeColssize of the rows and columns

Definition at line 158 of file STK_ICArray.h.

158: Base(), allocator_(sizeRows, sizeCols) {}

◆ ICArray() [3/7]

template<class Derived >
STK::ICArray< Derived >::ICArray ( int  sizeRows,
int  sizeCols,
Type const value 
)
inlineprotected

constructor with specified sizes and value.

Parameters
sizeRows,sizeColssize of the rows and columns
valuethe value to set

Definition at line 163 of file STK_ICArray.h.

163: Base(), allocator_(sizeRows, sizeCols, value) {}

◆ ICArray() [4/7]

template<class Derived >
STK::ICArray< Derived >::ICArray ( Derived const T,
bool  ref = false 
)
inlineprotected

copy or wrapper constructor.

Parameters
Tsize of the rows
refis this owning its own data ?

Definition at line 168 of file STK_ICArray.h.

168: Base(), allocator_(T.allocator_, ref) {}

◆ ICArray() [5/7]

template<class Derived >
STK::ICArray< Derived >::ICArray ( Type *const q,
int  sizeRows,
int  sizeCols 
)
inlineprotected

wrapper constructor for 0 based C-Array.

Parameters
qpointer on the array
sizeRows,sizeColssize of the rows and columns

Definition at line 173 of file STK_ICArray.h.

173: Base(), allocator_(q, sizeRows, sizeCols){}

◆ ICArray() [6/7]

template<class Derived >
template<class OtherAllocator >
STK::ICArray< Derived >::ICArray ( ITContainer2D< OtherAllocator > const allocator,
Range const I,
Range const J 
)
inlineprotected

constructor by reference, ref_=1.

Parameters
allocatorthe allocator to wrap
I,Jrange of the rows and columns to wrap

Definition at line 179 of file STK_ICArray.h.

180 : Base(), allocator_(allocator.asDerived(), I, J)
181 {}
Allocator const & allocator() const
Get a constant reference on the main allocator.

◆ ICArray() [7/7]

template<class Derived >
template<class OtherAllocator >
STK::ICArray< Derived >::ICArray ( ITContainer2D< OtherAllocator > const allocator)
inlineprotected

constructor by reference, ref_=1.

Parameters
allocatorwith the data

Definition at line 186 of file STK_ICArray.h.

187 : Base(), allocator_(allocator.asDerived(), true)
188 {}

◆ ~ICArray()

template<class Derived >
STK::ICArray< Derived >::~ICArray ( )
inlineprotected

destructor

Definition at line 190 of file STK_ICArray.h.

190{}

Member Function Documentation

◆ allocator()

template<class Derived >
Allocator const & STK::ICArray< Derived >::allocator ( ) const
inline

Get a constant reference on the main allocator.

Definition at line 206 of file STK_ICArray.h.

206{ return allocator_;}

References STK::ICArray< Derived >::allocator_.

◆ clear()

template<class Derived >
void STK::ICArray< Derived >::clear ( )
inline

clear all allocated memory .

Definition at line 198 of file STK_ICArray.h.

198{ allocator_.clear();}

References STK::ICArray< Derived >::allocator_.

Referenced by STK::CvHandler::setData(), and STK::PartitionHandler::setData().

◆ col() [1/3]

template<class Derived >
hidden::CSlice< Derived, sizeRows_, 1 >::Result STK::ICArray< Derived >::col ( int  j) const
inline

implement the col operator using a reference on the column of the allocator

Parameters
jindex of the column to reference

Definition at line 317 of file STK_ICArray.h.

If<(isNumber_), CArrayNumber< Type, orient_ >, typenameIf< isVector_, CArrayVector< Type, SizeRows, orient_ >, typenameIf< isPoint_, CArrayPoint< Type, SizeCols, orient_ >, typenameIf< isSquare_, CArraySquare< Type, SizeRows, orient_ >, CArray< Type, SizeRows, SizeCols, orient_ > >::Result >::Result >::Result >::Result Result
Definition STK_ICArray.h:92

References STK::ICArray< Derived >::allocator_.

Referenced by STK::KmmBase< Derived >::compute_dik(), STK::IMixtureStatModel::computeICL(), main(), STK::GammaBase< Derived >::moments(), STK::ICArray< Derived >::operator()(), STK::DiagGaussian_s< Array >::randomInit(), STK::DiagGaussian_sj< Array >::randomInit(), STK::DiagGaussian_sjk< Array >::randomInit(), STK::DiagGaussian_sjsk< Array >::randomInit(), STK::DiagGaussian_sk< Array >::randomInit(), STK::HDGaussian_AjkBkQkD< Array >::randomInit(), STK::Categorical_pjk< Array >::run(), STK::DiagGaussian_s< Array >::run(), STK::DiagGaussian_sj< Array >::run(), STK::DiagGaussian_sjk< Array >::run(), STK::DiagGaussian_sjsk< Array >::run(), STK::DiagGaussian_sk< Array >::run(), STK::HDGaussian_AjkBkQkD< Array >::run(), STK::DiagGaussianBase< Derived >::updateMean(), and STK::HDGaussianBase< Derived >::updateMean().

◆ col() [2/3]

template<class Derived >
template<int Size_>
hidden::CSlice< Derived, Size_, 1 >::Result STK::ICArray< Derived >::col ( TRange< Size_ > const I,
int  j 
) const
inline

implement the col operator using a reference on the column of the allocator

Parameters
I,jrange of the rows and index of the column to reference

Definition at line 323 of file STK_ICArray.h.

324 { return typename hidden::CSlice<Derived, Size_, 1>::Result( allocator_.col( I, j));}

References STK::ICArray< Derived >::allocator_.

◆ col() [3/3]

template<class Derived >
template<int Size_>
hidden::CSlice< Derived, sizeRows_, Size_ >::Result STK::ICArray< Derived >::col ( TRange< Size_ > const J) const
inline

implement the col operator using a reference on a range of columns of the allocator

Parameters
Jrange of columns to reference

Definition at line 329 of file STK_ICArray.h.

330 { return typename hidden::CSlice<Derived, sizeRows_, Size_>::Result( allocator_.sub(this->rows(), J));}

References STK::ICArray< Derived >::allocator_.

◆ colsImpl()

template<class Derived >
ColRange const & STK::ICArray< Derived >::colsImpl ( ) const
inline
Returns
the Horizontal range

Definition at line 193 of file STK_ICArray.h.

193{ return allocator_.cols();};

References STK::ICArray< Derived >::allocator_.

◆ elt0Impl() [1/2]

template<class Derived >
Type & STK::ICArray< Derived >::elt0Impl ( )
inline

implement the const element accessor for number arrays

Definition at line 221 of file STK_ICArray.h.

221{ return allocator_.elt();}

References STK::ICArray< Derived >::allocator_.

◆ elt0Impl() [2/2]

template<class Derived >
TypeConst STK::ICArray< Derived >::elt0Impl ( ) const
inline

implement the writable element accessor for number arrays

Definition at line 223 of file STK_ICArray.h.

223{ return allocator_.elt();}

References STK::ICArray< Derived >::allocator_.

◆ elt1Impl() [1/2]

template<class Derived >
Type & STK::ICArray< Derived >::elt1Impl ( int  j)
inline

implement the const element accessor for vector/point/diagonal arrays

Definition at line 216 of file STK_ICArray.h.

216{ return allocator_.elt(j);}

References STK::ICArray< Derived >::allocator_.

◆ elt1Impl() [2/2]

template<class Derived >
TypeConst STK::ICArray< Derived >::elt1Impl ( int  j) const
inline

implement the writable element accessor for vector/point/diagonal arrays

Definition at line 218 of file STK_ICArray.h.

218{ return allocator_.elt(j);}

References STK::ICArray< Derived >::allocator_.

◆ elt2Impl() [1/2]

template<class Derived >
Type & STK::ICArray< Derived >::elt2Impl ( int  i,
int  j 
)
inline

implement the const element accessor

Definition at line 211 of file STK_ICArray.h.

211{ return allocator_.elt(i, j);}

References STK::ICArray< Derived >::allocator_.

◆ elt2Impl() [2/2]

template<class Derived >
TypeConst STK::ICArray< Derived >::elt2Impl ( int  i,
int  j 
) const
inline

implement the writable element accessor

Definition at line 213 of file STK_ICArray.h.

213{ return allocator_.elt(i, j);}

References STK::ICArray< Derived >::allocator_.

◆ empty()

template<class Derived >
bool STK::ICArray< Derived >::empty ( ) const
inline
Returns
true if the container is empty, false otherwise

Definition at line 201 of file STK_ICArray.h.

201{ return allocator_.empty();}

References STK::ICArray< Derived >::allocator_.

Referenced by STK::ISymEigen< Derived >::run().

◆ exchange()

template<class Derived >
void STK::ICArray< Derived >::exchange ( Derived &  T)
inline

exchange this with T.

Parameters
Tthe container to exchange with this

Definition at line 408 of file STK_ICArray.h.

408{ allocator_.exchange(T.allocator_);}

References STK::ICArray< Derived >::allocator_.

◆ isRef()

template<class Derived >
bool STK::ICArray< Derived >::isRef ( ) const
inline

◆ move()

template<class Derived >
void STK::ICArray< Derived >::move ( Derived const T)
inline

move T to this.

Parameters
Tthe array to move

Definition at line 412 of file STK_ICArray.h.

412{ allocator_.move(T.allocator_);}

References STK::ICArray< Derived >::allocator_.

◆ operator()() [1/7]

template<class Derived >
Type & STK::ICArray< Derived >::operator() ( )
inline
Returns
the number

Definition at line 284 of file STK_ICArray.h.

284{ return this->elt();}

◆ operator()() [2/7]

template<class Derived >
TypeConst STK::ICArray< Derived >::operator() ( ) const
inline
Returns
a constant reference on the number

Definition at line 286 of file STK_ICArray.h.

286{ return this->elt();}

◆ operator()() [3/7]

template<class Derived >
Type & STK::ICArray< Derived >::operator() ( int  i,
int  j 
)
inline
Returns
a reference on the element (i,j) of the 2D container.
Parameters
i,jindexes of the element to get

Definition at line 234 of file STK_ICArray.h.

235 {
236#ifdef STK_BOUNDS_CHECK
237 if (this->beginRows() > i) { STKOUT_OF_RANGE_2ARG(ICArray::operator(), i, j, beginRows() > i);}
238 if (this->endRows() <= i) { STKOUT_OF_RANGE_2ARG(ICArray::operator(), i, j, endRows() <= i);}
239 if (this->beginCols() > j) { STKOUT_OF_RANGE_2ARG(ICArray::operator(), i, j, beginCols() > j);}
240 if (this->endCols() <= j) { STKOUT_OF_RANGE_2ARG(ICArray::operator(), i, j, endCols() <= j);}
241#endif
242 return this->elt(i,j);
243 }
#define STKOUT_OF_RANGE_2ARG(Where, Arg1, Arg2, Error)
Definition STK_Macros.h:102

References STKOUT_OF_RANGE_2ARG.

◆ operator()() [4/7]

template<class Derived >
TypeConst STK::ICArray< Derived >::operator() ( int  i,
int  j 
) const
inline
Returns
a constant reference on the element (i,j) of the 2D container.
Parameters
i,jrow and column indexes

Definition at line 247 of file STK_ICArray.h.

248 {
249#ifdef STK_BOUNDS_CHECK
250 if (this->beginRows() > i) { STKOUT_OF_RANGE_2ARG(ICArray::operator(), i, j, beginRows() > i);}
251 if (this->endRows() <= i) { STKOUT_OF_RANGE_2ARG(ICArray::operator(), i, j, endRows() <= i);}
252 if (this->beginCols() > j) { STKOUT_OF_RANGE_2ARG(ICArray::operator(), i, j, beginCols() > j);}
253 if (this->endCols() <= j) { STKOUT_OF_RANGE_2ARG(ICArray::operator(), i, j, endCols() <= j);}
254#endif
255 return this->elt(i,j);
256 }

References STKOUT_OF_RANGE_2ARG.

◆ operator()() [5/7]

template<class Derived >
template<int Size_>
hidden::CSlice< Derived, 1, Size_ >::Result STK::ICArray< Derived >::operator() ( int  i,
TRange< Size_ > const J 
) const
inline
Parameters
i,Jindex of the row and range of the columns
Returns
an Horizontal container referencing row i in range J

Definition at line 304 of file STK_ICArray.h.

305 { return row(i, J);}
hidden::CSlice< Derived, 1, sizeCols_ >::Result row(int i) const
implement the row operator using a reference on the row of the allocator

References STK::ICArray< Derived >::row().

◆ operator()() [6/7]

template<class Derived >
template<int OtherRows_, int OtherCols_>
hidden::CSlice< Derived, OtherRows_, OtherCols_ >::Result STK::ICArray< Derived >::operator() ( TRange< OtherRows_ > const I,
TRange< OtherCols_ > const J 
) const
inline
Parameters
I,Jrange of the rows and columns
Returns
a 2D container containing this in the range I, J

Definition at line 368 of file STK_ICArray.h.

369 { return sub(I, J);}
hidden::CSliceDispatcher< Derived, Size >::Result sub(TRange< Size > const &J) const
implement the sub operator for 1D arrays using a reference on the row/column of the allocator

References STK::ICArray< Derived >::sub().

◆ operator()() [7/7]

template<class Derived >
template<int Size_>
hidden::CSlice< Derived, Size_, 1 >::Result STK::ICArray< Derived >::operator() ( TRange< Size_ > const I,
int  j 
) const
inline
Parameters
I,jrange of the rows and index of the column to reference
Returns
a Vertical container containing the column j of this in the range I

Definition at line 335 of file STK_ICArray.h.

336 { return col(I, j);}
hidden::CSlice< Derived, sizeRows_, 1 >::Result col(int j) const
implement the col operator using a reference on the column of the allocator

References STK::ICArray< Derived >::col().

◆ operator[]() [1/3]

template<class Derived >
Type & STK::ICArray< Derived >::operator[] ( int  i)
inline
Returns
a reference on the ith element
Parameters
iindex of the element to get

Definition at line 261 of file STK_ICArray.h.

262 {
264#ifdef STK_BOUNDS_CHECK
265 if (this->asDerived().begin() > i) { STKOUT_OF_RANGE_1ARG(ICArray::operator[], i, begin() > i);}
266 if (this->asDerived().end() <= i) { STKOUT_OF_RANGE_1ARG(ICArray::operator[], i, end() <= i);}
267#endif
268 return this->elt(i);
269 }
#define STKOUT_OF_RANGE_1ARG(Where, Arg, Error)
Definition STK_Macros.h:93
#define STK_STATIC_ASSERT_ONE_DIMENSION_ONLY(EXPR)

References STK_STATIC_ASSERT_ONE_DIMENSION_ONLY, and STKOUT_OF_RANGE_1ARG.

◆ operator[]() [2/3]

template<class Derived >
TypeConst STK::ICArray< Derived >::operator[] ( int  i) const
inline
Returns
the ith element
Parameters
iindex of the element to get

Definition at line 273 of file STK_ICArray.h.

274 {
276#ifdef STK_BOUNDS_CHECK
277 if (this->asDerived().begin() > i) { STKOUT_OF_RANGE_1ARG(ICArray::operator[], i, begin() > i);}
278 if (this->asDerived().end() <= i) { STKOUT_OF_RANGE_1ARG(ICArray::operator[], i, end() <= i);}
279#endif
280 return this->elt(i);
281 }

References STK_STATIC_ASSERT_ONE_DIMENSION_ONLY, and STKOUT_OF_RANGE_1ARG.

◆ operator[]() [3/3]

template<class Derived >
template<int Size>
hidden::CSliceDispatcher< Derived, Size >::Result STK::ICArray< Derived >::operator[] ( TRange< Size > const I) const
inline
Returns
the sub-vector in given range
Parameters
Irange to get

Definition at line 352 of file STK_ICArray.h.

353 {
355 return sub(I);
356 }

References STK_STATIC_ASSERT_ONE_DIMENSION_ONLY, and STK::ICArray< Derived >::sub().

◆ p_data()

template<class Derived >
Type *const & STK::ICArray< Derived >::p_data ( ) const
inline

◆ resize() [1/3]

template<class Derived >
Derived & STK::ICArray< Derived >::resize ( int  size)
inline

Resize the vector/point/diagonal/square array.

Parameters
sizeRange of the vector/point/diagonal/square array
Note
if this method is used with arrays, upper triangular and lower triangular arrays, both ranges will be resized.

Definition at line 482 of file STK_ICArray.h.

483 {
484 if (!hidden::CheckShift<Derived, structure_>::resize(this->asDerived(), size)) return this->asDerived();
485 if (this->isRef())
486 { STKRUNTIME_ERROR_1ARG(ICArray::resize,size,cannot operate on reference);}
487 allocator_.resize(size);
488 return this->asDerived();
489 }
#define STKRUNTIME_ERROR_1ARG(Where, Arg, Error)
Definition STK_Macros.h:129
Derived & resize(Range const &I, Range const &J)
resize the Array.
bool isRef() const

References STK::ICArray< Derived >::allocator_, STK::ICArray< Derived >::isRef(), STK::ICArray< Derived >::resize(), and STKRUNTIME_ERROR_1ARG.

◆ resize() [2/3]

template<class Derived >
Derived & STK::ICArray< Derived >::resize ( Range const I,
Range const J 
)
inline

resize the Array.

Parameters
I,Jrange of the rows and columns

Definition at line 444 of file STK_ICArray.h.

445 {
447 ||(structure_ == (int)Arrays::square_)
448 ||(structure_ == (int)Arrays::diagonal_)
454 ,YOU_CANNOT_USED_THIS_METHOD_WITH_THIS_KIND_OF_ARRAY);
455 if (!hidden::CheckShift<Derived, structure_>::isAllowed(this->asDerived(), I, J))
456 { STKRUNTIME_ERROR_2ARG(ICArray::resize,I,J,not permited);}
457 if (!hidden::CheckShift<Derived, structure_>::resize(this->asDerived(), I, J)) return this->asDerived();
458 if (this->isRef())
459 { STKRUNTIME_ERROR_2ARG(ICArray::resize,I,J,cannot operate on reference);}
460 allocator_.resize(I.size(), J.size()).shift(I.begin(), J.begin());
461 return this->asDerived();
462 }
#define STKRUNTIME_ERROR_2ARG(Where, Arg1, Arg2, Error)
Definition STK_Macros.h:120
#define STK_STATIC_ASSERT(COND, MSG)
@ array2D_
general matrix/array/expression
@ lower_symmetric_
lower symmetric matrix/array/expression
@ lower_triangular_
lower triangular matrix/array/expression
@ symmetric_
symmetric matrix/array/expression
@ upper_triangular_
upper triangular matrix/array/expression
@ diagonal_
diagonal matrix/array/expression
@ upper_symmetric_
upper symmetric matrix/array/expression
@ square_
square matrix/array/expression

References STK::ICArray< Derived >::allocator_, STK::Arrays::array2D_, STK::Arrays::diagonal_, STK::ICArray< Derived >::isRef(), STK::Arrays::lower_symmetric_, STK::Arrays::lower_triangular_, STK::ICArray< Derived >::resize(), STK::Arrays::square_, STK_STATIC_ASSERT, STKRUNTIME_ERROR_2ARG, STK::ICArray< Derived >::structure_, STK::Arrays::symmetric_, STK::Arrays::upper_symmetric_, and STK::Arrays::upper_triangular_.

Referenced by STK::lapack::MultiLeastSquare< ArrayB, ArrayA >::computeLS(), STK::lapack::Svd::computeSvd(), STK::Stat::Factor< Array >::Factor(), STK::Stat::MultiFactor< Array >::MultiFactor(), STK::CvHandler::partition(), STK::PartitionHandler::partition(), STK::ICArray< Derived >::resize(), STK::ICArray< Derived >::resize(), STK::Bernoulli_pjParameters::resize(), STK::DiagGaussian_muj_sjParameters::resize(), STK::ModelGamma_aj_bjParameters::resize(), STK::ICArray< Derived >::resize(), STK::ISymEigen< Derived >::setData(), and STK::WeightedSvd< Array, WRows, WCols >::WeightedSvd().

◆ resize() [3/3]

template<class Derived >
template<int Size_>
Derived & STK::ICArray< Derived >::resize ( TRange< Size_ > const I)
inline

Resize the vector/point/diagonal/square array.

Parameters
IRange of the vector
Note
if this method is used with arrays, upper triangular and lower triangular arrays, both ranges will be resized.

Definition at line 469 of file STK_ICArray.h.

470 {
471 if (!hidden::CheckShift<Derived, structure_>::resize(this->asDerived(), I)) return this->asDerived();
472 if (this->isRef())
473 { STKRUNTIME_ERROR_1ARG(ICArray::resize,I,cannot operate on reference);}
474 allocator_.resize(I.size()).shift(I.begin());
475 return this->asDerived();
476 }

References STK::ICArray< Derived >::allocator_, STK::ICArray< Derived >::isRef(), STK::ICArray< Derived >::resize(), and STKRUNTIME_ERROR_1ARG.

◆ row() [1/3]

◆ row() [2/3]

template<class Derived >
template<int Size_>
hidden::CSlice< Derived, 1, Size_ >::Result STK::ICArray< Derived >::row ( int  i,
TRange< Size_ > const J 
) const
inline

implement the row operator using a reference on the row of the allocator

Parameters
i,Jindex of the row and range of the columns to reference

Definition at line 298 of file STK_ICArray.h.

299 { return typename hidden::CSlice<Derived, 1, Size_>::Result( allocator_.row( i, J));}

References STK::ICArray< Derived >::allocator_.

◆ row() [3/3]

template<class Derived >
template<int Size_>
hidden::CSlice< Derived, Size_, sizeCols_ >::Result STK::ICArray< Derived >::row ( TRange< Size_ > const I) const
inline

implement the row operator using a reference on a range of rows of the allocator

Parameters
Irange of the rows to reference

Definition at line 310 of file STK_ICArray.h.

311 { return typename hidden::CSlice<Derived, Size_, sizeCols_>::Result( allocator_.sub(I, this->cols()));}

References STK::ICArray< Derived >::allocator_.

◆ rowsImpl()

template<class Derived >
RowRange const & STK::ICArray< Derived >::rowsImpl ( ) const
inline
Returns
the Vertical range

Definition at line 195 of file STK_ICArray.h.

195{ return allocator_.rows();}

References STK::ICArray< Derived >::allocator_.

◆ setValueImpl() [1/2]

template<class Derived >
void STK::ICArray< Derived >::setValueImpl ( int  i,
int  j,
TypeConst  value 
)
inline

implement setValue for vector/point/diagonal arrays

Definition at line 228 of file STK_ICArray.h.

228{ allocator_.elt(i,j) = value ;}

References STK::ICArray< Derived >::allocator_.

◆ setValueImpl() [2/2]

template<class Derived >
void STK::ICArray< Derived >::setValueImpl ( int  j,
TypeConst  value 
)
inline

implement setValue for vector/point/diagonal arrays

Definition at line 226 of file STK_ICArray.h.

226{ allocator_.elt(j) = value ;}

References STK::ICArray< Derived >::allocator_.

◆ shift() [1/2]

template<class Derived >
Derived & STK::ICArray< Derived >::shift ( int  beginRows,
int  beginCols 
)
inline

shift the Array.

Parameters
beginRows,beginColsfirst indexes of the rows and columns

Definition at line 416 of file STK_ICArray.h.

417 {
421 ,YOU_CANNOT_USED_THIS_METHOD_WITH_THIS_KIND_OF_ARRAY);
422 if (!hidden::CheckShift<Derived, structure_>::shift(this->asDerived(), beginRows, beginCols)) return this->asDerived();
423 if (this->isRef())
424 { STKRUNTIME_ERROR_2ARG(ICArray::shift,beginRows,beginCols,cannot operate on reference);}
425 allocator_.shift(beginRows, beginCols);
426 return this->asDerived();
427 }
Derived & shift(int beginRows, int beginCols)
shift the Array.

References STK::ICArray< Derived >::allocator_, STK::Arrays::array2D_, STK::ICArray< Derived >::isRef(), STK::Arrays::lower_triangular_, STK::ICArray< Derived >::shift(), STK_STATIC_ASSERT, STKRUNTIME_ERROR_2ARG, STK::ICArray< Derived >::structure_, and STK::Arrays::upper_triangular_.

Referenced by STK::lapack::MultiLeastSquare< ArrayB, ArrayA >::computeLS(), STK::lapack::Svd::computeSvd(), STK::lapack::Qr::runImpl(), STK::lapack::SymEigen< SquareArray >::runImpl(), STK::ICArray< Derived >::shift(), and STK::ICArray< Derived >::shift().

◆ shift() [2/2]

template<class Derived >
Derived & STK::ICArray< Derived >::shift ( int  firstIdx)
inline

shift the Array.

Parameters
firstIdxfirst index of the vector/point/diagonal/square array.
Note
if this method is used with arrays, upper triangular and lower triangular arrays, both indexes will be shifted.

Definition at line 433 of file STK_ICArray.h.

434 {
435 if (!hidden::CheckShift<Derived, structure_>::shift(this->asDerived(), firstIdx)) return this->asDerived();
436 if (this->isRef())
437 { STKRUNTIME_ERROR_1ARG(ICArray::shift,firstIdx,cannot operate on reference);}
438 allocator_.shift(firstIdx);
439 return this->asDerived();
440 }

References STK::ICArray< Derived >::allocator_, STK::ICArray< Derived >::isRef(), STK::ICArray< Derived >::shift(), and STKRUNTIME_ERROR_1ARG.

◆ sub() [1/2]

template<class Derived >
template<int OtherRows_, int OtherCols_>
hidden::CSlice< Derived, OtherRows_, OtherCols_ >::Result STK::ICArray< Derived >::sub ( TRange< OtherRows_ > const I,
TRange< OtherCols_ > const J 
) const
inline

implement the sub operator for 2D arrays using references on a range of rows and columns of the allocator

Parameters
I,Jrange of the rows and columns to reference

Definition at line 362 of file STK_ICArray.h.

References STK::ICArray< Derived >::allocator_.

◆ sub() [2/2]

template<class Derived >
template<int Size>
hidden::CSliceDispatcher< Derived, Size >::Result STK::ICArray< Derived >::sub ( TRange< Size > const J) const
inline

implement the sub operator for 1D arrays using a reference on the row/column of the allocator

Parameters
Jrange to get

Definition at line 343 of file STK_ICArray.h.

344 {
346 return typename hidden::CSliceDispatcher<Derived, Size>::Result( allocator_.subVector(J));
347 }
If< structure_==(int) Arrays::vector_, typenameCSlice< Derived, Size, 1 >::Result, typenameCSlice< Derived, 1, Size >::Result >::Result Result

References STK::ICArray< Derived >::allocator_, and STK_STATIC_ASSERT_ONE_DIMENSION_ONLY.

Referenced by STK::lapack::MultiLeastSquare< ArrayB, ArrayA >::computeLS(), main(), STK::ICArray< Derived >::operator()(), STK::ICArray< Derived >::operator[](), STK::lapack::MultiLeastSquare< ArrayB, ArrayA >::runImpl(), and STK::lapack::MultiLeastSquare< ArrayB, ArrayA >::runImpl().

◆ swap()

template<class Derived >
void STK::ICArray< Derived >::swap ( int  i,
int  j 
)
inline

swap two elements: only for vectors an points.

Definition at line 372 of file STK_ICArray.h.

372{ std::swap(this->elt(i), this->elt(j)); }

◆ swapCols()

template<class Derived >
void STK::ICArray< Derived >::swapCols ( int  pos1,
int  pos2 
)
inline
Parameters
pos1,pos2positions of the columns to swap

Definition at line 374 of file STK_ICArray.h.

375 {
376#ifdef STK_BOUNDS_CHECK
377 if (this->beginCols() > pos1)
378 { STKOUT_OF_RANGE_2ARG(ICArray::swapCols,pos1, pos2,beginCols() > pos1);}
379 if (this->endCols() <= pos1)
380 { STKOUT_OF_RANGE_2ARG(ICArray::swapCols,pos1, pos2,endCols() <= pos1);}
381 if (this->beginCols() > pos2)
382 { STKOUT_OF_RANGE_2ARG(ICArray::swapCols,pos1, pos2,beginCols() > pos2);}
383 if (this->endCols() <= pos2)
384 { STKOUT_OF_RANGE_2ARG(ICArray::swapCols,pos1, pos2,endCols() <= pos2);}
385#endif
386 // swap allocator
387 allocator_.swapCols(pos1, pos2);
388 }
void swapCols(int pos1, int pos2)

References STK::ICArray< Derived >::allocator_, STKOUT_OF_RANGE_2ARG, and STK::ICArray< Derived >::swapCols().

Referenced by STK::ICArray< Derived >::swapCols().

◆ swapRows()

template<class Derived >
void STK::ICArray< Derived >::swapRows ( int  pos1,
int  pos2 
)
inline
Parameters
pos1,pos2positions of the rows to swap

Definition at line 390 of file STK_ICArray.h.

391 {
392#ifdef STK_BOUNDS_CHECK
393 if (this->beginRows() > pos1)
394 { STKOUT_OF_RANGE_2ARG(ICArray::swapRows,pos1, pos2,beginRows() > pos1);}
395 if (this->endRows() <= pos1)
396 { STKOUT_OF_RANGE_2ARG(ICArray::swapRows,pos1, pos2,endRows() <= pos1);}
397 if (this->beginRows() > pos2)
398 { STKOUT_OF_RANGE_2ARG(ICArray::swapRows,pos1, pos2,beginRows() > pos2);}
399 if (this->endRows() <= pos2)
400 { STKOUT_OF_RANGE_2ARG(ICArray::swapRows,pos1, pos2,endRows() <= pos2);}
401#endif
402 // swap allocator
403 allocator_.swapRows(pos1, pos2);
404 }
void swapRows(int pos1, int pos2)

References STK::ICArray< Derived >::allocator_, STKOUT_OF_RANGE_2ARG, and STK::ICArray< Derived >::swapRows().

Referenced by STK::ICArray< Derived >::swapRows().

Member Data Documentation

◆ allocator_


The documentation for this class was generated from the following file: