36#ifndef STK_ARRAYBASE_H
37#define STK_ARRAYBASE_H
45#define MAKE_RESHAPE_OPERATOR(OPERATOR, SHAPE) \
46 inline OPERATOR##Operator< Derived> const SHAPE() const \
47 { return OPERATOR##Operator< Derived>(this->asDerived()); } \
48 inline OPERATOR##Accessor< Derived> SHAPE() \
49 { return OPERATOR##Accessor< Derived>(this->asDerived()); }
66template<
class Derived>
105 template<
typename Visitor>
133 { this->asDerived().setValueImpl(
i, value);}
138 { this->asDerived().setValueImpl(
i,
j, value);}
154 template<
typename Rhs>
158 template<
typename Rhs>
161 template<
typename Rhs>
164 template<
typename Rhs>
167 template<
typename Rhs>
170 template<
typename Rhs>
223 template<
int SizeRows_,
int SizeCols_>
243 template<
int SizeRows_,
int SizeCols_>
256#ifdef STK_BOUNDS_CHECK
262 return this->elt(
i,
j);}
268#ifdef STK_BOUNDS_CHECK
274 return this->elt(
i,
j);
282#ifdef STK_BOUNDS_CHECK
294#ifdef STK_BOUNDS_CHECK
312 template<
typename Rhs>
318#undef MAKE_RESHAPE_OPERATOR
In this file we define the appliers on writable arrays.
In this file we implement the copy and assign methods.
In this file we implement the ArrayInitializer class.
#define MAKE_RESHAPE_OPERATOR(OPERATOR, SHAPE)
utility macro allowing to construct unary operators
In this file we define the base class for Arrays and Expressions.
#define STKOUT_OF_RANGE_1ARG(Where, Arg, Error)
#define STKOUT_OF_RANGE_2ARG(Where, Arg1, Arg2, Error)
In this file we implement the DiagonalAccessor, DiagonalGetterAccessor, UpperTriangularizeAccessor,...
In this file we implement the RowAccessor, ColAccessor, SubVectorAccessor and SubAccessor classes.
#define STK_STATIC_ASSERT_ONE_DIMENSION_ONLY(EXPR)
#define STK_STATIC_ASSERT_TWO_DIMENSIONS_ONLY(EXPR)
In this file we implement the TransposeAccessor class.
base class for template arrays.
SubVectorAccessor< Derived, Size_ > sub(TRange< Size_ > const &I)
ArrayInitializer< Derived > operator<<(Type const &s)
Convenient operator to set the coefficients of a matrix.
TransposeOperator< Derived > const transpose() const
Derived & operator+=(ExprBase< Rhs > const &other)
Add Rhs to this.
Derived & zeros()
set zero to this using a Visitor.
Derived & operator=(Type const &value)
void setValue(int i, int j, TypeConst value)
set a value to this container at position (i,j).
DiagonalGetterOperator< Derived > const getDiagonal() const
Derived & copy(ExprBase< Rhs > const &rhs)
overwrite this with src.
UpperTriangularizeOperator< Derived > const upperTriangularize() const
SubAccessor< Derived, SizeRows_, SizeCols_ > sub(TRange< SizeRows_ > const &I, TRange< SizeCols_ > const &J)
Derived & setValue(TypeConst value)
set a value to this container.
ArrayBase()
Default constructor.
Derived & ones()
set one to this using a Visitor.
ColOperator< Derived > const col(int j) const
SubOperator< Derived, SizeRows_, SizeCols_ > const sub(TRange< SizeRows_ > const &I, TRange< SizeCols_ > const &J) const
hidden::Traits< Derived >::Type Type
LowerSymmetrizeOperator< Derived > const lowerSymmetrize() const
Derived & assign(ExprBase< Rhs > const &rhs)
Derived & operator/=(ExprBase< Rhs > const &other)
divide this by Rhs.
Type & operator()(int i, int j)
RowOperator< Derived > const row(int i) const
Derived & operator*=(ExprBase< Rhs > const &other)
multiply this by Rhs.
Derived & randUnif()
set random values to this using a uniform law.
ColAccessor< Derived > col(int j)
void apply(Visitor &visitor)
Apply the Visitor visitor to the whole coefficients of the array.
Derived & setZeros()
set zero to this using a Visitor.
void setValue(int i, TypeConst value)
set a value to this container at index i.
TypeConst operator()() const
hidden::Traits< Derived >::TypeConst TypeConst
Derived & randGauss()
set random values to this using a standard gaussian law.
Derived & operator-=(ExprBase< Rhs > const &other)
subtract a Rhs to this.
TypeConst operator()(int i, int j) const
Derived & rand(Law::IUnivLaw< Type > const &law)
set random values to this using a distribution law given by the user.
SymmetrizeOperator< Derived > const symmetrize() const
RowAccessor< Derived > row(int i)
SubVectorOperator< Derived, Size_ > const sub(TRange< Size_ > const &I) const
DiagonalizeOperator< Derived > const diagonalize() const
TypeConst operator[](int i) const
Derived & operator%=(ExprBase< Rhs > const &other)
Take modulo of this by Rhs.
UpperSymmetrizeOperator< Derived > const upperSymmetrize() const
Derived & setOnes()
set one to this using a Visitor.
LowerTriangularizeOperator< Derived > const lowerTriangularize() const
Generic expression when the column of an expression is accessed.
base class for template evaluation expressions and visitors.
Interface base class for all the univariate distributions.
The MultidimRegression class allows to regress a multidimensional output variable among a multivariat...
The namespace STK is the main domain space of the Statistical ToolKit project.