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

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

#include <STK_SlicingAccessors.h>

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

Public Types

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

Public Member Functions

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

Detailed Description

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

Generic expression when the column of an expression is accessed.

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

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

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

Definition at line 199 of file STK_SlicingAccessors.h.

Member Typedef Documentation

◆ Base

Definition at line 202 of file STK_SlicingAccessors.h.

◆ ColRange

Type of the Range for the columns.

Definition at line 216 of file STK_SlicingAccessors.h.

◆ RowRange

Type of the Range for the rows.

Definition at line 214 of file STK_SlicingAccessors.h.

◆ Type

Definition at line 203 of file STK_SlicingAccessors.h.

◆ TypeConst

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

Definition at line 204 of file STK_SlicingAccessors.h.

Member Enumeration Documentation

◆ anonymous enum

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

Definition at line 205 of file STK_SlicingAccessors.h.

206 {
207 structure_ = hidden::Traits< ColAccessor<Lhs> >::structure_,
208 orient_ = hidden::Traits< ColAccessor<Lhs> >::orient_,
209 sizeRows_ = hidden::Traits< ColAccessor<Lhs> >::sizeRows_,
210 sizeCols_ = hidden::Traits< ColAccessor<Lhs> >::sizeCols_,
211 storage_ = hidden::Traits< ColAccessor<Lhs> >::storage_
212 };

Constructor & Destructor Documentation

◆ ColAccessor()

template<typename Lhs >
STK::ColAccessor< Lhs >::ColAccessor ( Lhs lhs,
int  j 
)
inline

constructor

Definition at line 219 of file STK_SlicingAccessors.h.

220 : Base(), lhs_(lhs), j_(j), rows_(lhs_.rangeRowsInCol(j_)), cols_(j_,1) {}
ExprBase< ColAccessor< Lhs > > Base
Lhs const & lhs() const

Member Function Documentation

◆ colsImpl()

template<typename Lhs >
ColRange const & STK::ColAccessor< Lhs >::colsImpl ( ) const
inline
Returns
the columns range

Definition at line 227 of file STK_SlicingAccessors.h.

227{ return cols_;}

◆ elt0Impl() [1/2]

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

access to the element

Definition at line 263 of file STK_SlicingAccessors.h.

263{ return (lhs_.elt(j_));}

◆ elt0Impl() [2/2]

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

access to the element

Definition at line 246 of file STK_SlicingAccessors.h.

246{ return (lhs_.elt(j_));}

◆ elt1Impl() [1/2]

template<typename Lhs >
Type & STK::ColAccessor< Lhs >::elt1Impl ( int  i)
inline
Returns
the element ith element
Parameters
iindex of the element to get

Definition at line 261 of file STK_SlicingAccessors.h.

261{ return (lhs_.elt(i, j_));}

◆ elt1Impl() [2/2]

template<typename Lhs >
TypeConst STK::ColAccessor< Lhs >::elt1Impl ( int  i) const
inline
Returns
the element ith element
Parameters
iindex of the element to get

Definition at line 244 of file STK_SlicingAccessors.h.

244{ return (lhs_.elt(i, j_));}

◆ elt2Impl() [1/2]

template<typename Lhs >
Type & STK::ColAccessor< Lhs >::elt2Impl ( int  i,
int  j 
)
inline
Returns
the ith element of the column
Parameters
i,jindexes of the element

Definition at line 251 of file STK_SlicingAccessors.h.

252 {
253#ifdef STK_BOUNDS_CHECK
254 if (j != j_) { STKRUNTIME_ERROR_2ARG(ColOperatorBase::elt2Impl,i,j,column index is not valid);}
255#endif
256 return (lhs_.elt(i, j_));
257 }
#define STKRUNTIME_ERROR_2ARG(Where, Arg1, Arg2, Error)
Definition STK_Macros.h:120

References STKRUNTIME_ERROR_2ARG.

◆ elt2Impl() [2/2]

template<typename Lhs >
TypeConst STK::ColAccessor< Lhs >::elt2Impl ( int  i,
int  j 
) const
inline
Returns
the ith element of the column
Parameters
i,jindexes of the element

Definition at line 234 of file STK_SlicingAccessors.h.

235 {
236#ifdef STK_BOUNDS_CHECK
237 if (j != j_) { STKRUNTIME_ERROR_2ARG(ColOperatorBase::elt2Impl,i,j,column index is not valid);}
238#endif
239 return (lhs_.elt(i, j_));
240 }

References STKRUNTIME_ERROR_2ARG.

◆ lhs()

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

Definition at line 230 of file STK_SlicingAccessors.h.

230{ return lhs_; }

◆ rowsImpl()

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

Definition at line 225 of file STK_SlicingAccessors.h.

225{ return rows_;}

Member Data Documentation

◆ cols_

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

Definition at line 269 of file STK_SlicingAccessors.h.

◆ j_

template<typename Lhs >
const int STK::ColAccessor< Lhs >::j_
protected

Definition at line 267 of file STK_SlicingAccessors.h.

◆ lhs_

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

Definition at line 266 of file STK_SlicingAccessors.h.

◆ rows_

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

Definition at line 268 of file STK_SlicingAccessors.h.


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