35#ifndef STK_SLICINGOPERATORS_H
36#define STK_SLICINGOPERATORS_H
41template<
typename Array>
class RowOperator;
42template<
typename Array>
class ColOperator;
44template<
typename Array,
int Size_>
class SubVectorOperator;
46template<
typename Array,
int SizeRows_,
int SizeCols_>
class SubOperator;
61 orient_ =
Lhs::orient_,
63 sizeCols_ =
Lhs::sizeCols_,
64 storage_ =
Lhs::storage_
68 typedef typename Lhs::Type
Type;
87template<
typename Lhs>
108 inline RowOperator(
Lhs const& lhs,
int i):
Base(), lhs_(lhs), i_(
i), rows_(i_, 1), cols_(lhs_.rangeColsInRow(i_)) {}
117 inline Lhs const&
lhs()
const {
return lhs_;}
123#ifdef STK_BOUNDS_CHECK
126 return (lhs().elt(i_,
j));
148template<
typename Lhs>
153 structure_ = ( Lhs::structure_ !=
int(Arrays::point_) && Lhs::structure_ !=
int(Arrays::number_) )
154 ? Arrays::vector_ : Arrays::number_,
156 sizeRows_ =
Lhs::sizeRows_,
158 storage_ =
Lhs::storage_
162 typedef typename Lhs::Type
Type;
182template<
typename Lhs>
204 :
Base(), lhs_(lhs), j_(
j), rows_(lhs_.rangeRowsInCol(j_)), cols_(j_,1) {}
214 inline Lhs const&
lhs()
const {
return lhs_; }
220#ifdef STK_BOUNDS_CHECK
223 return (lhs_.elt(
i, j_));
245template<
typename Lhs,
int Size_>
250 structure_ = Lhs::structure_,
251 orient_ = Lhs::orient_,
252 sizeRows_ = (structure_ ==
int(Arrays::point_)) ? 1 :
Size_,
253 sizeCols_ = (structure_ ==
int(Arrays::vector_)) ? 1 :
Size_,
254 storage_ =
Lhs::storage_
258 typedef typename Lhs::Type
Type;
265template<
typename Lhs,
int Size_,
int Structure_>
283template<
typename Lhs,
int Size_>
285 , hidden::Traits< SubVectorOperator<Lhs, Size_> >::structure_
310 inline Lhs const&
lhs()
const {
return lhs_;}
343template<
typename Lhs,
int Size_>
373template<
typename Lhs,
int Size_>
403template<
typename Lhs,
int Size_>
435template<
typename Lhs,
int SizeRows_,
int SizeCols_>
440 structure_ = Lhs::structure_,
441 orient_ = Lhs::orient_,
444 storage_ = Lhs::storage_
446 typedef typename Lhs::Type
Type;
466template<
typename Lhs,
int SizeRows_,
int SizeCols_>
490 :
Base(), lhs_(lhs), rows_(
I), cols_(
J) {}
496 inline Lhs const&
lhs()
const {
return lhs_;}
#define STKRUNTIME_ERROR_2ARG(Where, Arg1, Arg2, Error)
Generic expression when the column of an expression is accessed.
TypeConst elt0Impl() const
access to the element
TRange< sizeRows_ > RowRange
Type of the Range for the rows.
ColOperator(Lhs const &lhs, int j)
constructor
hidden::Traits< ColOperator< Lhs > >::TypeConst TypeConst
hidden::Traits< ColOperator< Lhs > >::Type Type
TRange< sizeCols_ > ColRange
Type of the Range for the columns.
TypeConst elt1Impl(int i) const
ExprBase< ColOperator< Lhs > > Base
RowRange const & rowsImpl() const
TypeConst elt2Impl(int i, int j) const
ColRange const & colsImpl() const
base class for template evaluation expressions and visitors.
The MultidimRegression class allows to regress a multidimensional output variable among a multivariat...
Generic expression when the row of an expression is accessed.
TRange< sizeRows_ > RowRange
Type of the Range for the rows.
TypeConst elt1Impl(int j) const
ExprBase< RowOperator< Lhs > > Base
hidden::Traits< RowOperator< Lhs > >::TypeConst TypeConst
TypeConst elt2Impl(int i, int j) const
RowOperator(Lhs const &lhs, int i)
constructor
TypeConst elt0Impl() const
accesses to the element
ColRange const & colsImpl() const
hidden::Traits< RowOperator< Lhs > >::Type Type
TRange< sizeCols_ > ColRange
Type of the Range for the columns.
RowRange const & rowsImpl() const
Generic expression when the sub-part of an expression is accessed.
TypeConst elt1Impl(int i) const
TypeConst elt2Impl(int i, int j) const
hidden::Traits< SubOperator< Lhs, SizeRows_, SizeCols_ > >::Type Type
TRange< sizeRows_ > RowRange
Type of the Range for the rows.
TypeConst elt0Impl() const
accesses to the element
SubOperator(Lhs const &lhs, RowRange const &I, ColRange const &J)
constructor
hidden::Traits< SubOperator< Lhs, SizeRows_, SizeCols_ > >::TypeConst TypeConst
ExprBase< SubOperator< Lhs, SizeRows_, SizeCols_ > > Base
TRange< sizeCols_ > ColRange
Type of the Range for the columns.
ColRange const & colsImpl() const
RowRange const & rowsImpl() const
RowRange const & rowsImpl() const
ColRange const & colsImpl() const
TRange< sizeRows_ > RowRange
Type of the Range for the rows.
SubVectorOperatorBase(RowRange const &I)
constructor
SubVectorOperator< Lhs, Size_ > Derived
TRange< sizeCols_ > ColRange
Type of the Range for the columns.
TRange< sizeCols_ > ColRange
Type of the Range for the columns.
SubVectorOperator< Lhs, Size_ > Derived
RowRange const & rowsImpl() const
ColRange const & colsImpl() const
TRange< sizeRows_ > RowRange
Type of the Range for the rows.
SubVectorOperatorBase(ColRange const &J)
constructor
ColRange const & colsImpl() const
RowRange const & rowsImpl() const
SubVectorOperatorBase(RowRange const &I)
constructor
TRange< sizeCols_ > ColRange
Type of the Range for the columns.
SubVectorOperator< Lhs, Size_ > Derived
TRange< sizeRows_ > RowRange
Type of the Range for the rows.
Specialization for point_.
Generic expression when the sub-part of an expression is accessed (specialization for vectors)
hidden::Traits< SubVectorOperator< Lhs, Size_ > >::TypeConst TypeConst
SubVectorOperatorBase< Lhs, Size_, structure_ > Base
TRange< sizeRows_ > RowRange
Type of the Range for the rows.
TypeConst elt2Impl(int i, int j) const
Type & elt0Impl()
accesses to the element
Type & elt2Impl(int i, int j)
SubVectorOperator(Lhs const &lhs, TRange< Size_ > const &I)
constructor
TypeConst elt0Impl() const
accesses to the element
TRange< sizeCols_ > ColRange
Type of the Range for the columns.
TypeConst elt1Impl(int i) const
hidden::Traits< SubVectorOperator< Lhs, Size_ > >::Type Type
@ number_
(1,1) matrix/vector/array/expression (like a number)
@ point_
row oriented vector/array/expression
@ vector_
column oriented vector/array/expression
The namespace STK is the main domain space of the Statistical ToolKit project.
Base class for all referencing containers.
RowOperator< ColOperator< Lhs > > Row
ColOperator< ColOperator< Lhs > > Col
RowOperator< RowOperator< Lhs > > Row
ColOperator< RowOperator< Lhs > > Col
RowOperator< SubVectorOperator< Lhs, Size_ > > Row
ColOperator< SubVectorOperator< Lhs, Size_ > > Col