STK++ 0.9.13
STK::RowAccessor< Lhs > Class Template Reference

Generic expression when the row of an expression is accessed. More...

#include <STK_SlicingAccessors.h>

Inheritance diagram for STK::RowAccessor< Lhs >:
Inheritance graph

Public Types

enum  {
  structure_ = hidden::Traits< RowAccessor<Lhs> >::structure_ , orient_ = hidden::Traits< RowAccessor<Lhs> >::orient_ , sizeRows_ = hidden::Traits< RowAccessor<Lhs> >::sizeRows_ , sizeCols_ = hidden::Traits< RowAccessor<Lhs> >::sizeCols_ ,
  storage_ = hidden::Traits< RowAccessor<Lhs> >::storage_
}
 
typedef ExprBase< RowAccessor< Lhs > > Base
 
typedef hidden::Traits< RowAccessor< Lhs > >::Type Type
 
typedef hidden::Traits< RowAccessor< Lhs > >::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::ExprBase< RowAccessor< Lhs > >
enum  
 
typedef ITContainer< RowAccessor< Lhs >, structure_ > Base
 
typedef hidden::Traits< RowAccessor< Lhs > >::Type Type
 
typedef hidden::Traits< RowAccessor< Lhs > >::TypeConst TypeConst
 

Public Member Functions

 RowAccessor (Lhs &lhs, int i)
 constructor
 
RowRange constrowsImpl () const
 
ColRange constcolsImpl () const
 
Lhs constlhs () const
 
TypeConst elt2Impl (int i, int j) const
 
TypeConst elt1Impl (int j) const
 
TypeConst elt0Impl () const
 accesses to the element
 
Typeelt2Impl (int i, int j)
 
Typeelt1Impl (int j)
 
Typeelt0Impl ()
 accesses to the element
 
- Public Member Functions inherited from STK::ExprBase< RowAccessor< Lhs > >
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 minElt (int &pos) const
 
Type const minElt () const
 
Type const minEltSafe (int &row, int &col) const
 
Type const minEltSafe (int &pos) const
 
Type const minEltSafe () const
 
Type const maxElt (int &row, int &col) const
 
Type const maxElt (int &pos) const
 
Type const maxElt () const
 
Type const maxEltSafe (int &row, int &col) const
 
Type const maxEltSafe (int &pos) 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 variance (Type const &mean) const
 
Type const varianceSafe () const
 
Type const varianceSafe (Type const &mean) const
 
Type const wsum (ExprBase< Rhs > const &weights) const
 
hidden::Traits< RowAccessor< Lhs > >::Type const wsum (ExprBase< Rhs > const &weights) const
 
Type const wsumSafe (ExprBase< Rhs > const &weights) const
 
hidden::Traits< RowAccessor< Lhs > >::Type const wsumSafe (ExprBase< Rhs > const &weights) const
 
Type const wnorm (ExprBase< Rhs > const &weights) const
 
hidden::Traits< RowAccessor< Lhs > >::Type const wnorm (ExprBase< Rhs > const &weights) const
 
Type const wnormSafe (ExprBase< Rhs > const &weights) const
 
hidden::Traits< RowAccessor< Lhs > >::Type const wnormSafe (ExprBase< Rhs > const &weights) const
 
Type const wnorm2 (ExprBase< Rhs > const &weights) const
 
hidden::Traits< RowAccessor< Lhs > >::Type const wnorm2 (ExprBase< Rhs > const &weights) const
 
Type const wnorm2Safe (ExprBase< Rhs > const &weights) const
 
hidden::Traits< RowAccessor< Lhs > >::Type const wnorm2Safe (ExprBase< Rhs > const &weights) const
 
Type const wmean (ExprBase< Rhs > const &weights) const
 
hidden::Traits< RowAccessor< Lhs > >::Type const wmean (ExprBase< Rhs > const &weights) const
 
Type const wmeanSafe (ExprBase< Rhs > const &weights) const
 
hidden::Traits< RowAccessor< Lhs > >::Type const wmeanSafe (ExprBase< Rhs > const &weights) const
 
Type const wvariance (ExprBase< Rhs > const &weights) const
 
Type const wvariance (Type const &mean, ExprBase< Rhs > const &weights) const
 
hidden::Traits< RowAccessor< Lhs > >::Type const wvariance (ExprBase< Rhs > const &weights) const
 
hidden::Traits< RowAccessor< Lhs > >::Type const wvariance (Type const &mean, ExprBase< Rhs > const &weights) const
 
Type const wvarianceSafe (ExprBase< Rhs > const &weights) const
 
Type const wvarianceSafe (Type const &mean, ExprBase< Rhs > const &weights) const
 
hidden::Traits< RowAccessor< Lhs > >::Type const wvarianceSafe (ExprBase< Rhs > const &weights) const
 
hidden::Traits< RowAccessor< Lhs > >::Type const wvarianceSafe (Type const &mean, ExprBase< Rhs > const &weights) const
 
hidden::OperatorSelector< RowAccessor< Lhs >, Rhs, Arrays::equalOp_ >::Result const operator== (ExprBase< Rhs > const &other) const
 
UnaryOperator< EqualWithOp< Type >, RowAccessor< Lhs > > operator== (Type const &value) const
 
hidden::OperatorSelector< RowAccessor< Lhs >, Rhs, Arrays::notEqualOp_ >::Result const operator!= (ExprBase< Rhs > const &other) const
 
UnaryOperator< NotEqualWithOp< Type >, RowAccessor< Lhs > > operator!= (Type const &value) const
 
hidden::OperatorSelector< RowAccessor< Lhs >, Rhs, Arrays::greaterThanOp_ >::Result const operator> (ExprBase< Rhs > const &other) const
 
UnaryOperator< GreaterThanOp< Type >, RowAccessor< Lhs > > operator> (Type const &value) const
 
hidden::OperatorSelector< RowAccessor< Lhs >, Rhs, Arrays::lessThanOp_ >::Result const operator< (ExprBase< Rhs > const &other) const
 
UnaryOperator< LessThanOp< Type >, RowAccessor< Lhs > > operator< (Type const &value) const
 
hidden::OperatorSelector< RowAccessor< Lhs >, Rhs, Arrays::greaterThanOrEqualOp_ >::Result const operator>= (ExprBase< Rhs > const &other) const
 
UnaryOperator< GeqThanOp< Type >, RowAccessor< Lhs > > operator>= (Type const &value) const
 
hidden::OperatorSelector< RowAccessor< Lhs >, Rhs, Arrays::lessThanOrEqualOp_ >::Result const operator<= (ExprBase< Rhs > const &other) const
 
UnaryOperator< LeqThanOp< Type >, RowAccessor< Lhs > > operator<= (Type const &value) const
 
hidden::OperatorSelector< RowAccessor< Lhs >, Rhs, Arrays::sumOp_ >::Result const operator+ (ExprBase< Rhs > const &other) const
 
UnaryOperator< SumWithOp< Type >, RowAccessor< Lhs > > operator+ (Type const &value) const
 
hidden::OperatorSelector< RowAccessor< Lhs >, Rhs, Arrays::differenceOp_ >::Result const operator- (ExprBase< Rhs > const &other) const
 
UnaryOperator< OppositeOp< Type >, RowAccessor< Lhs > > operator- () const
 
UnaryOperator< DifferenceWithOp< Type >, RowAccessor< Lhs > > operator- (Type const &value) const
 
hidden::OperatorSelector< RowAccessor< Lhs >, Rhs, Arrays::productOp_ >::Result const prod (ExprBase< Rhs > const &other) const
 
hidden::OperatorSelector< RowAccessor< Lhs >, Rhs, Arrays::divisionOp_ >::Result const operator/ (ExprBase< Rhs > const &other) const
 
UnaryOperator< DivisionWithOp< Type >, RowAccessor< Lhs > > operator/ (Type const &value) const
 
hidden::OperatorSelector< RowAccessor< Lhs >, Rhs, Arrays::moduloOp_ >::Result const operator% (ExprBase< Rhs > const &other) const
 
UnaryOperator< ModuloWithOp< Type >, RowAccessor< Lhs > > operator% (Type const &value) const
 
hidden::OperatorSelector< RowAccessor< Lhs >, Rhs, Arrays::minOp_ >::Result const min (ExprBase< Rhs > const &other) const
 
UnaryOperator< MinWithOp< Type >, RowAccessor< Lhs > > min (Type const &value) const
 
hidden::OperatorSelector< RowAccessor< Lhs >, Rhs, Arrays::maxOp_ >::Result const max (ExprBase< Rhs > const &other) const
 
UnaryOperator< MaxWithOp< Type >, RowAccessor< Lhs > > max (Type const &value) const
 
hidden::OperatorSelector< RowAccessor< Lhs >, Rhs, Arrays::logicalAndOp_ >::Result const operator&& (ExprBase< Rhs > const &other) const
 
UnaryOperator< LogicalAndWithOp< Type >, RowAccessor< Lhs > > operator&& (Type const &value) const
 
hidden::OperatorSelector< RowAccessor< Lhs >, Rhs, Arrays::logicalOrOp_ >::Result const operator|| (ExprBase< Rhs > const &other) const
 
UnaryOperator< LogicalOrWithOp< Type >, RowAccessor< Lhs > > operator|| (Type const &value) const
 
hidden::OperatorSelector< RowAccessor< Lhs >, Rhs, Arrays::bitwiseAndOp_ >::Result const operator& (ExprBase< Rhs > const &other) const
 
UnaryOperator< BitwiseAndWithOp< Type >, RowAccessor< Lhs > > operator& (Type const &value) const
 
hidden::OperatorSelector< RowAccessor< Lhs >, Rhs, Arrays::bitwiseOrOp_ >::Result const operator| (ExprBase< Rhs > const &other) const
 
UnaryOperator< BitwiseOrWithOp< Type >, RowAccessor< Lhs > > operator| (Type const &value) const
 
hidden::OperatorSelector< RowAccessor< Lhs >, Rhs, Arrays::bitwiseXorOp_ >::Result const operator^ (ExprBase< Rhs > const &other) const
 
UnaryOperator< BitwiseXorWithOp< Type >, RowAccessor< Lhs > > operator^ (Type const &value) const
 
UnaryOperator< IsNaOp< Type >, RowAccessor< Lhs > > isNA () const
 
UnaryOperator< NegOp< Type >, RowAccessor< Lhs > > neg () const
 
UnaryOperator< IsFiniteOp< Type >, RowAccessor< Lhs > > isFinite () const
 
UnaryOperator< IsInfiniteOp< Type >, RowAccessor< Lhs > > isInfinite () const
 
UnaryOperator< AbsOp< Type >, RowAccessor< Lhs > > abs () const
 
UnaryOperator< ExpOp< Type >, RowAccessor< Lhs > > exp () const
 
UnaryOperator< LogOp< Type >, RowAccessor< Lhs > > log () const
 
UnaryOperator< SqrtOp< Type >, RowAccessor< Lhs > > sqrt () const
 
UnaryOperator< CosOp< Type >, RowAccessor< Lhs > > cos () const
 
UnaryOperator< SinOp< Type >, RowAccessor< Lhs > > sin () const
 
UnaryOperator< AcosOp< Type >, RowAccessor< Lhs > > acos () const
 
UnaryOperator< AsinOp< Type >, RowAccessor< Lhs > > asin () const
 
UnaryOperator< TanOp< Type >, RowAccessor< Lhs > > tan () const
 
UnaryOperator< InverseOp< Type >, RowAccessor< Lhs > > inverse () const
 
UnaryOperator< SquareOp< Type >, RowAccessor< Lhs > > square () const
 
UnaryOperator< CubeOp< Type >, RowAccessor< Lhs > > cube () const
 
UnaryOperator< ProductWithOp< Type >, RowAccessor< Lhs > > operator* (Type const &value) const
 
hidden::ProductSelector< RowAccessor< Lhs >, Rhs, hidden::Traits< RowAccessor< Lhs > >::structure_, hidden::Traits< Rhs >::structure_ >::ProductType const operator* (ExprBase< Rhs > const &other) const
 
UnaryOperator< PowOp< Type >, RowAccessor< Lhs > > pow (Type const &value) const
 
UnaryOperator< SafeInverseOp< Type >, RowAccessor< Lhs > > safeInverse (Type const &value) const
 
UnaryOperator< SafeOp< Type >, RowAccessor< Lhs > > const safe (Type const value=Type()) const
 
UnaryOperator< CastOp< Type, OtherType >, RowAccessor< Lhs > > const cast () const
 
UnaryOperator< Law::PdfOp< Type >, RowAccessor< Lhs > > pdf (Law::IUnivLaw< Type > const &law) const
 compute pdf values to this using distribution law given by user
 
UnaryOperator< Law::LogPdfOp< Type >, RowAccessor< Lhs > > lpdf (Law::IUnivLaw< Type > const &law) const
 compute log-pdf values to this using distribution law given by user
 
UnaryOperator< Law::CdfOp< Type >, RowAccessor< Lhs > > cdf (Law::IUnivLaw< Type > const &law) const
 compute cumulative distribution function of this using distribution law given by user
 
UnaryOperator< Law::LogCdfOp< Type >, RowAccessor< Lhs > > lcdf (Law::IUnivLaw< Type > const &law) const
 compute log-cumulative distribution function of this using distribution law given by user
 
UnaryOperator< Law::CdfcOp< Type >, RowAccessor< Lhs > > cdfc (Law::IUnivLaw< Type > const &law) const
 compute complementary cumulative distribution function of this using distribution law given by user
 
UnaryOperator< Law::LogCdfcOp< Type >, RowAccessor< Lhs > > lcdfc (Law::IUnivLaw< Type > const &law) const
 compute complementary cumulative distribution function of this using distribution law given by user
 
UnaryOperator< Law::IcdfOp< Type >, RowAccessor< Lhs > > icdf (Law::IUnivLaw< Type > const &law) const
 compute inverse cumulative distribution function using distribution law given by user
 
UnaryOperator< OtherOperator< Type >, RowAccessor< Lhs > > const funct0 () const
 
UnaryOperator< OtherOperator< Type >, RowAccessor< Lhs > > const funct1 (Type const value) const
 
TransposeOperator< RowAccessor< Lhs > > const transpose () const
 
DiagonalizeOperator< RowAccessor< Lhs > > const diagonalize () const
 
DiagonalGetterOperator< RowAccessor< Lhs > > const getDiagonal () const
 
UpperTriangularizeOperator< RowAccessor< Lhs > > const upperTriangularize () const
 
LowerTriangularizeOperator< RowAccessor< Lhs > > const lowerTriangularize () const
 
SymmetrizeOperator< RowAccessor< Lhs > > const symmetrize () const
 
UpperSymmetrizeOperator< RowAccessor< Lhs > > const upperSymmetrize () const
 
LowerSymmetrizeOperator< RowAccessor< Lhs > > const lowerSymmetrize () const
 
SubVectorOperator< RowAccessor< Lhs >, Size_ > const sub (TRange< Size_ > const &I) const
 
SubOperator< RowAccessor< Lhs >, SizeRows_, SizeCols_ > const sub (TRange< SizeRows_ > const &I, TRange< SizeCols_ > const &J) const
 
ColOperator< RowAccessor< Lhs > > const col (int j) const
 
SubOperator< RowAccessor< Lhs >, sizeRows_, Size_ > const col (TRange< Size_ > const &J) const
 
RowOperator< RowAccessor< Lhs > > const row (int i) const
 
SubOperator< RowAccessor< Lhs >, Size_, sizeCols_ > const row (TRange< Size_ > const &I) const
 
hidden::Promote< Type, typenameRhs::Type >::result_type const dot (ExprBase< Rhs > const &other) const
 
hidden::Promote< Type, typenameRhs::Type >::result_type const dotSafe (ExprBase< Rhs > const &other) const
 

Protected Attributes

Lhslhs_
 
int i_
 
const RowRange rows_
 
const ColRange cols_
 

Additional Inherited Members

- Static Public Member Functions inherited from STK::TRef< 1 >
static bool isRef ()
 
- Protected Member Functions inherited from STK::ExprBase< RowAccessor< Lhs > >
 ExprBase ()
 Default constructor.
 
 ~ExprBase ()
 destructor
 

Detailed Description

template<typename Lhs>
class STK::RowAccessor< Lhs >

Generic expression when the row of an expression is accessed.

Template Parameters
Lhsthe type of the expression to which we are applying the row accessor.

This class represents an expression where a row operator is applied to an expression. It is the return type of the row operation.

Most of the time, this is the only way that it is used, so you typically don't have to name RowOperator type explicitly.

Definition at line 87 of file STK_SlicingAccessors.h.

Member Typedef Documentation

◆ Base

Definition at line 90 of file STK_SlicingAccessors.h.

◆ ColRange

Type of the Range for the columns.

Definition at line 104 of file STK_SlicingAccessors.h.

◆ RowRange

Type of the Range for the rows.

Definition at line 102 of file STK_SlicingAccessors.h.

◆ Type

Definition at line 91 of file STK_SlicingAccessors.h.

◆ TypeConst

template<typename Lhs >
typedef hidden::Traits<RowAccessor<Lhs>>::TypeConst STK::RowAccessor< Lhs >::TypeConst

Definition at line 92 of file STK_SlicingAccessors.h.

Member Enumeration Documentation

◆ anonymous enum

template<typename Lhs >
anonymous enum
Enumerator
structure_ 
orient_ 
sizeRows_ 
sizeCols_ 
storage_ 

Definition at line 93 of file STK_SlicingAccessors.h.

94 {
95 structure_ = hidden::Traits< RowAccessor<Lhs> >::structure_,
96 orient_ = hidden::Traits< RowAccessor<Lhs> >::orient_,
97 sizeRows_ = hidden::Traits< RowAccessor<Lhs> >::sizeRows_,
98 sizeCols_ = hidden::Traits< RowAccessor<Lhs> >::sizeCols_,
99 storage_ = hidden::Traits< RowAccessor<Lhs> >::storage_
100 };

Constructor & Destructor Documentation

◆ RowAccessor()

template<typename Lhs >
STK::RowAccessor< Lhs >::RowAccessor ( Lhs lhs,
int  i 
)
inline

constructor

Definition at line 107 of file STK_SlicingAccessors.h.

107: Base(), lhs_(lhs), i_(i), rows_(i_, 1), cols_(lhs_.rangeColsInRow(i_)) {}
Lhs const & lhs() const
ExprBase< RowAccessor< Lhs > > Base

Member Function Documentation

◆ colsImpl()

template<typename Lhs >
ColRange const & STK::RowAccessor< Lhs >::colsImpl ( ) const
inline
Returns
the range of the Columns

Definition at line 114 of file STK_SlicingAccessors.h.

114{ return cols_;}

◆ elt0Impl() [1/2]

template<typename Lhs >
Type & STK::RowAccessor< Lhs >::elt0Impl ( )
inline

accesses to the element

Definition at line 150 of file STK_SlicingAccessors.h.

150{ return (lhs().elt());}

◆ elt0Impl() [2/2]

template<typename Lhs >
TypeConst STK::RowAccessor< Lhs >::elt0Impl ( ) const
inline

accesses to the element

Definition at line 132 of file STK_SlicingAccessors.h.

132{ return (lhs().elt());}

◆ elt1Impl() [1/2]

template<typename Lhs >
Type & STK::RowAccessor< Lhs >::elt1Impl ( int  j)
inline
Returns
the element jth element
Parameters
jindex of the jth element

Definition at line 147 of file STK_SlicingAccessors.h.

148 { return (lhs().elt(i_, j));}

◆ elt1Impl() [2/2]

template<typename Lhs >
TypeConst STK::RowAccessor< Lhs >::elt1Impl ( int  j) const
inline
Returns
the element jth element
Parameters
jindex of the jth element

Definition at line 130 of file STK_SlicingAccessors.h.

130{ return (lhs().elt(i_, j));}

◆ elt2Impl() [1/2]

template<typename Lhs >
Type & STK::RowAccessor< Lhs >::elt2Impl ( int  i,
int  j 
)
inline
Returns
the element (i,j)
Parameters
i,jindex of the row and column

Definition at line 137 of file STK_SlicingAccessors.h.

138 {
139#ifdef STK_BOUNDS_CHECK
140 if (i != i_) { STKRUNTIME_ERROR_2ARG(RowOperatorBase::elt2Impl,i,j,row index is not valid);}
141#endif
142 return (lhs().elt(i_, j));
143 }
#define STKRUNTIME_ERROR_2ARG(Where, Arg1, Arg2, Error)
Definition STK_Macros.h:120
RowOperator< RowAccessor< Lhs > > const row(int i) const

References STKRUNTIME_ERROR_2ARG.

◆ elt2Impl() [2/2]

template<typename Lhs >
TypeConst STK::RowAccessor< Lhs >::elt2Impl ( int  i,
int  j 
) const
inline
Returns
the element (i,j)
Parameters
i,jindex of the row and column

Definition at line 120 of file STK_SlicingAccessors.h.

121 {
122#ifdef STK_BOUNDS_CHECK
123 if (i != i_) { STKRUNTIME_ERROR_2ARG(RowOperatorBase::elt2Impl,i,j,row index is not valid);}
124#endif
125 return (lhs().elt(i_, j));
126 }

References STKRUNTIME_ERROR_2ARG.

◆ lhs()

template<typename Lhs >
Lhs const & STK::RowAccessor< Lhs >::lhs ( ) const
inline
Returns
the left hand side expression

Definition at line 116 of file STK_SlicingAccessors.h.

116{ return lhs_;}

◆ rowsImpl()

template<typename Lhs >
RowRange const & STK::RowAccessor< Lhs >::rowsImpl ( ) const
inline
Returns
the range of the rows

Definition at line 112 of file STK_SlicingAccessors.h.

112{ return rows_;}

Member Data Documentation

◆ cols_

template<typename Lhs >
const ColRange STK::RowAccessor< Lhs >::cols_
protected

Definition at line 156 of file STK_SlicingAccessors.h.

◆ i_

template<typename Lhs >
int STK::RowAccessor< Lhs >::i_
protected

Definition at line 154 of file STK_SlicingAccessors.h.

◆ lhs_

template<typename Lhs >
Lhs& STK::RowAccessor< Lhs >::lhs_
protected

Definition at line 153 of file STK_SlicingAccessors.h.

◆ rows_

template<typename Lhs >
const RowRange STK::RowAccessor< Lhs >::rows_
protected

Definition at line 155 of file STK_SlicingAccessors.h.


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