STK++ 0.9.13
STK::UnaryOperator< UnaryOp, Lhs > Class Template Reference

Generic expression when unary operator is applied to an expression. More...

#include <STK_UnaryOperators.h>

Inheritance diagram for STK::UnaryOperator< UnaryOp, Lhs >:
Inheritance graph

Public Types

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

Public Member Functions

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

Lhs constlhs_
 
UnaryOp const functor_
 

Additional Inherited Members

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

Detailed Description

template<typename UnaryOp, typename Lhs>
class STK::UnaryOperator< UnaryOp, Lhs >

Generic expression when unary operator is applied to an expression.

Template Parameters
UnaryOptemplate functor implementing the operator
Lhsthe type of the expression to which we are applying the unary operator

This class represents an expression where a unary operator is applied to an expression. It is the return type of all operations taking exactly 1 input expression, regardless of the presence of other inputs such as numbers. For example, the operator* in the expression 3*matrix is considered unary, because only the right-hand side is an expression, and its return type is a specialization of UnaryOperator.

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

Definition at line 91 of file STK_UnaryOperators.h.

Member Typedef Documentation

◆ Base

◆ ColRange

Type of the Range for the columns.

Definition at line 109 of file STK_UnaryOperators.h.

◆ RowRange

Type of the Range for the rows.

Definition at line 107 of file STK_UnaryOperators.h.

◆ Type

◆ TypeConst

Definition at line 96 of file STK_UnaryOperators.h.

Member Enumeration Documentation

◆ anonymous enum

Enumerator
structure_ 
orient_ 
sizeRows_ 
sizeCols_ 
storage_ 

Definition at line 98 of file STK_UnaryOperators.h.

99 {
100 structure_ = hidden::Traits< UnaryOperator >::structure_,
101 orient_ = hidden::Traits< UnaryOperator >::orient_,
102 sizeRows_ = hidden::Traits< UnaryOperator >::sizeRows_,
103 sizeCols_ = hidden::Traits< UnaryOperator >::sizeCols_,
104 storage_ = hidden::Traits< UnaryOperator >::storage_
105 };

Constructor & Destructor Documentation

◆ UnaryOperator()

template<typename UnaryOp , typename Lhs >
STK::UnaryOperator< UnaryOp, Lhs >::UnaryOperator ( Lhs const lhs,
UnaryOp const functor = UnaryOp() 
)
inline

Definition at line 111 of file STK_UnaryOperators.h.

113 {}
ExprBase< UnaryOperator< UnaryOp, Lhs > > Base
UnaryOp const & functor() const
Lhs const & lhs() const

Member Function Documentation

◆ colsImpl()

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

Definition at line 117 of file STK_UnaryOperators.h.

117{ return lhs_.cols();}

References STK::UnaryOperator< UnaryOp, Lhs >::lhs_.

◆ elt0Impl()

template<typename UnaryOp , typename Lhs >
TypeConst STK::UnaryOperator< UnaryOp, Lhs >::elt0Impl ( ) const
inline
Returns
the element of the operator

Definition at line 134 of file STK_UnaryOperators.h.

134{ return functor_(lhs_.elt());}

References STK::UnaryOperator< UnaryOp, Lhs >::functor_, and STK::UnaryOperator< UnaryOp, Lhs >::lhs_.

◆ elt1Impl()

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

Definition at line 132 of file STK_UnaryOperators.h.

132{ return functor_(lhs_.elt(i));}

References STK::UnaryOperator< UnaryOp, Lhs >::functor_, and STK::UnaryOperator< UnaryOp, Lhs >::lhs_.

◆ elt2Impl()

template<typename UnaryOp , typename Lhs >
TypeConst STK::UnaryOperator< UnaryOp, Lhs >::elt2Impl ( int  i,
int  j 
) const
inline
Returns
the element (i,j) of the operator.
Parameters
iindex of the row
jindex of the column

Definition at line 128 of file STK_UnaryOperators.h.

128{ return functor_(lhs_.elt(i, j));}

References STK::UnaryOperator< UnaryOp, Lhs >::functor_, and STK::UnaryOperator< UnaryOp, Lhs >::lhs_.

◆ functor()

template<typename UnaryOp , typename Lhs >
UnaryOp const & STK::UnaryOperator< UnaryOp, Lhs >::functor ( ) const
inline
Returns
the functor representing the unary operation

Definition at line 122 of file STK_UnaryOperators.h.

122{ return functor_; }

References STK::UnaryOperator< UnaryOp, Lhs >::functor_.

◆ lhs()

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

Definition at line 120 of file STK_UnaryOperators.h.

120{ return lhs_; }

References STK::UnaryOperator< UnaryOp, Lhs >::lhs_.

◆ rowsImpl()

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

Definition at line 115 of file STK_UnaryOperators.h.

115{ return lhs_.rows();}

References STK::UnaryOperator< UnaryOp, Lhs >::lhs_.

Member Data Documentation

◆ functor_

◆ lhs_


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