STK++ 0.9.13
STK::ExprBase< Derived > Class Template Reference

base class for template evaluation expressions and visitors. More...

#include <STK_ExprBase.h>

Inherits STK::ITContainer< Derived, hidden::Traits< Derived >::structure_ >.

Inherited by STK::ArrayBase< Array2D< Type_ > >, STK::ArrayBase< Array2DDiagonal< Type_ > >, STK::ArrayBase< Array2DLowerTriangular< Type_ > >, STK::ArrayBase< Array2DNumber< Type_ > >, STK::ArrayBase< Array2DPoint< Type_ > >, STK::ArrayBase< Array2DSquare< Type_ > >, STK::ArrayBase< Array2DUpperTriangular< Type_ > >, STK::ArrayBase< Array2DVector< Type_ > >, STK::ArrayBase< CArray< Type_, SizeRows_, SizeCols_, Orient_ > >, STK::ArrayBase< CArrayNumber< Type_, Orient_ > >, STK::ArrayBase< CArrayPoint< Type_, SizeCols_, Orient_ > >, STK::ArrayBase< CArraySquare< Type_, Size_, Orient_ > >, STK::ArrayBase< CArrayVector< Type_, SizeRows_, Orient_ > >, STK::ArrayBase< Array2DPoint< int > >, STK::ArrayBase< DiagonalGetterAccessor< Lhs > >, STK::ArrayBase< DiagonalizeAccessor< Lhs > >, STK::ArrayBase< CArray< Real, SizeRows_, SizeCols_, Orient_ > >, STK::ArrayBase< Array2DVector< Real > >, STK::ArrayBase< LowerSymmetrizeAccessor< Lhs > >, STK::ArrayBase< LowerTriangularizeAccessor< Lhs > >, STK::ArrayBase< Array2DUpperTriangular< Real > >, STK::ArrayBase< SArray2D< Type_ > >, STK::ArrayBase< SArray2DDiagonal< Type_ > >, STK::ArrayBase< SArray2DLowerTriangular< Type_ > >, STK::ArrayBase< SArray2DNumber< Type_ > >, STK::ArrayBase< SArray2DPoint< Type_ > >, STK::ArrayBase< SArray2DSquare< Type_ > >, STK::ArrayBase< SArray2DUpperTriangular< Type_ > >, STK::ArrayBase< SArray2DVector< Type_ > >, STK::ArrayBase< CArraySquare< Type, Size_, Orient_ > >, STK::ArrayBase< CArrayVector< Type, SizeRows_, Orient_ > >, STK::ArrayBase< CArrayVector< int, SizeRows_, Orient_ > >, STK::ArrayBase< SymmetrizeAccessor< Lhs > >, STK::ArrayBase< TransposeAccessor< Lhs > >, STK::ArrayBase< UpperSymmetrizeAccessor< Lhs > >, STK::ArrayBase< UpperTriangularizeAccessor< Lhs > >, STK::ArrayBase< Array2D< Real > >, STK::ArrayBase< CArrayPoint< Type, SizeCols_, Orient_ > >, STK::ArrayBase< CArrayPoint< Real, SizeCols_, Orient_ > >, STK::ArrayBase< Array2D< Data::Type > >, STK::ArrayBase< Array2DSquare< Real > >, STK::ArrayBase< Array2DPoint< Real > >, STK::ArrayBase< CArraySquare< Real, Size_, Orient_ > >, STK::ArrayBase< Array2D< int > >, STK::ArrayBase< CArrayVector< Real, SizeRows_, Orient_ > >, STK::ArrayBase< Array2DDiagonal< Real > >, STK::ArrayBase< Array2DVector< Type > >, STK::ArrayBase< Array2DVector< int > >, STK::ArrayBase< CArray< int, SizeRows_, SizeCols_, Orient_ > >, STK::ArrayBase< CArrayPoint< int, SizeCols_, Orient_ > >, STK::ArrayBase< CArrayPoint< STK::Array2DVector< Type >, SizeCols_, Orient_ > >, STK::ArrayBase< CArrayPoint< Array2DVector< int >, SizeCols_, Orient_ > >, STK::ArrayBase< CArrayPoint< EncodingMap, SizeCols_, Orient_ > >, STK::ArrayBase< CArrayPoint< DecodingMap, SizeCols_, Orient_ > >, STK::Const::IConstArray< Array< Type_, SizeRows_, SizeCols_ > >, STK::Const::IConstArray< Identity< Type_, Size_ > >, STK::Const::IConstArray< LowerTriangular< Type_, SizeRows_, SizeCols_ > >, STK::Const::IConstArray< Point< Type_, Size_ > >, STK::Const::IConstArray< Square< Type_, Size_ > >, STK::Const::IConstArray< UpperTriangular< Type_, SizeRows_, SizeCols_ > >, STK::Const::IConstArray< Vector< Type_, Size_ > >, STK::ArrayBase< Derived >, and STK::Const::IConstArray< Derived >.

Public Types

enum  {
  structure_ = hidden::Traits<Derived>::structure_ , orient_ = hidden::Traits<Derived>::orient_ , sizeRows_ = hidden::Traits<Derived>::sizeRows_ , sizeCols_ = hidden::Traits<Derived>::sizeCols_ ,
  storage_ = hidden::Traits<Derived>::storage_
}
 
typedef ITContainer< Derived, structure_Base
 
typedef hidden::Traits< Derived >::Type Type
 
typedef hidden::Traits< Derived >::TypeConst TypeConst
 

Public Member Functions

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

Protected Member Functions

 ExprBase ()
 Default constructor.
 
 ~ExprBase ()
 destructor
 

Friends

UnaryOperator< SumWithOp< Type >, Derived > const operator+ (Type const &value, ExprBase< Derived > const &other)
 
UnaryOperator< SubstractToOp< Type >, Derived > const operator- (Type const value, ExprBase< Derived > const &other)
 
UnaryOperator< ProductWithOp< Type >, Derived > const operator* (Type const value, ExprBase< Derived > const &other)
 

Detailed Description

template<class Derived>
class STK::ExprBase< Derived >

base class for template evaluation expressions and visitors.

This class is the base that is inherited by all objects (matrix, vector, point and expression). The common API for these objects is contained in this class.

Template Parameters
Derivedis the derived type, e.g., a matrix, vector, type or an expression.

Definition at line 113 of file STK_ExprBase.h.

Member Typedef Documentation

◆ Base

template<class Derived >
typedef ITContainer<Derived, structure_> STK::ExprBase< Derived >::Base

Definition at line 124 of file STK_ExprBase.h.

◆ Type

template<class Derived >
typedef hidden::Traits<Derived>::Type STK::ExprBase< Derived >::Type

Definition at line 125 of file STK_ExprBase.h.

◆ TypeConst

template<class Derived >
typedef hidden::Traits<Derived>::TypeConst STK::ExprBase< Derived >::TypeConst

Definition at line 126 of file STK_ExprBase.h.

Member Enumeration Documentation

◆ anonymous enum

template<class Derived >
anonymous enum
Enumerator
structure_ 
orient_ 
sizeRows_ 
sizeCols_ 
storage_ 

Definition at line 116 of file STK_ExprBase.h.

117 {
118 structure_ = hidden::Traits<Derived>::structure_,
119 orient_ = hidden::Traits<Derived>::orient_,
120 sizeRows_ = hidden::Traits<Derived>::sizeRows_,
121 sizeCols_ = hidden::Traits<Derived>::sizeCols_,
122 storage_ = hidden::Traits<Derived>::storage_
123 };

Constructor & Destructor Documentation

◆ ExprBase()

template<class Derived >
STK::ExprBase< Derived >::ExprBase ( )
inlineprotected

Default constructor.

Definition at line 130 of file STK_ExprBase.h.

130: Base() {}
ITContainer< Derived, structure_ > Base

◆ ~ExprBase()

template<class Derived >
STK::ExprBase< Derived >::~ExprBase ( )
inlineprotected

destructor

Definition at line 132 of file STK_ExprBase.h.

132{}

Member Function Documentation

◆ abs()

template<class Derived >
UnaryOperator< AbsOp< Type >, Derived > STK::ExprBase< Derived >::abs ( ) const
inline
Returns
an expression of the absolute value of this

Definition at line 376 of file STK_ExprBase.h.

Referenced by main().

◆ acos()

template<class Derived >
UnaryOperator< AcosOp< Type >, Derived > STK::ExprBase< Derived >::acos ( ) const
inline
Returns
an expression of the arc cosine of this.

Definition at line 388 of file STK_ExprBase.h.

◆ all()

template<typename Derived >
bool const STK::ExprBase< Derived >::all ( ) const
inline

check if all the elements in an expression are not zero.

For example

(a > 0).all();
bool const all() const
check if all the elements in an expression are not zero.

will return true if all the elements in the expression a are positive.

Returns
true if all the elements are not zero in the expression, false otherwise.

Definition at line 88 of file STK_ExprBaseVisitor.h.

89{
90 hidden::AllVisitor<Type> visitor;
91 return visit(visitor);
92}
Visitor::TypeConst visit(Visitor &visitor) const
Visit the container using a constant visitor.

◆ any()

template<typename Derived >
bool const STK::ExprBase< Derived >::any ( ) const
inline

check if there is any non-zero element in an expression.

For example

(a > 0).any();
bool const any() const
check if there is any non-zero element in an expression.

will return true if there exists positive values in the expression a.

Returns
true if at least one element is not zero in the expression, false otherwise.

Definition at line 80 of file STK_ExprBaseVisitor.h.

81{
82 hidden::AnyVisitor<Type> visitor;
83 return visit(visitor);
84}

◆ asin()

template<class Derived >
UnaryOperator< AsinOp< Type >, Derived > STK::ExprBase< Derived >::asin ( ) const
inline
Returns
an expression of the arc sine of this.

Definition at line 390 of file STK_ExprBase.h.

◆ cast()

template<class Derived >
template<typename OtherType >
UnaryOperator< CastOp< Type, OtherType >, Derived > const STK::ExprBase< Derived >::cast ( ) const
inline
Returns
an expression of *this with the Type type casted to OtherType.

Definition at line 467 of file STK_ExprBase.h.

468 { return UnaryOperator<CastOp<Type, OtherType>, Derived>(this->asDerived());}

◆ cdf()

template<class Derived >
UnaryOperator< Law::CdfOp< Type >, Derived > STK::ExprBase< Derived >::cdf ( Law::IUnivLaw< Type > const law) const
inline

compute cumulative distribution function of this using distribution law given by user

Definition at line 478 of file STK_ExprBase.h.

479 { return UnaryOperator<Law::CdfOp<Type>, Derived>(this->asDerived(), Law::CdfOp<Type>(law));}

Referenced by main().

◆ cdfc()

template<class Derived >
UnaryOperator< Law::CdfcOp< Type >, Derived > STK::ExprBase< Derived >::cdfc ( Law::IUnivLaw< Type > const law) const
inline

compute complementary cumulative distribution function of this using distribution law given by user

Definition at line 484 of file STK_ExprBase.h.

485 { return UnaryOperator<Law::CdfcOp<Type>, Derived>(this->asDerived(), Law::CdfcOp<Type>(law));}

Referenced by main().

◆ col() [1/2]

template<class Derived >
ColOperator< Derived > const STK::ExprBase< Derived >::col ( int  j) const
inline
Returns
the j-th column of this.

Definition at line 531 of file STK_ExprBase.h.

532 { return ColOperator<Derived> (this->asDerived(), j);}

◆ col() [2/2]

template<class Derived >
template<int Size_>
SubOperator< Derived, sizeRows_, Size_ > const STK::ExprBase< Derived >::col ( TRange< Size_ > const J) const
inline
Returns
the range J of columns of this.

Definition at line 538 of file STK_ExprBase.h.

539 { return SubOperator<Derived, sizeRows_, Size_> (this->asDerived(), this->rows(), J);}

◆ cos()

template<class Derived >
UnaryOperator< CosOp< Type >, Derived > STK::ExprBase< Derived >::cos ( ) const
inline
Returns
an expression of the cosine of this.

Definition at line 384 of file STK_ExprBase.h.

◆ count()

template<typename Derived >
int STK::ExprBase< Derived >::count ( ) const
inline

compute the value of non-zero element in an expression.

For example

(a > 0).count();
int count() const
compute the value of non-zero element in an expression.

compute the value of positive element of the array a.

Returns
the value of non-zero element in the expression.

Definition at line 72 of file STK_ExprBaseVisitor.h.

73{
74 hidden::CountVisitor<Type> visitor;
75 return visit(visitor);
76}

◆ cube()

template<class Derived >
UnaryOperator< CubeOp< Type >, Derived > STK::ExprBase< Derived >::cube ( ) const
inline
Returns
an expression of the cube of this.

Definition at line 398 of file STK_ExprBase.h.

◆ diagonalize()

template<class Derived >
DiagonalizeOperator< Derived > const STK::ExprBase< Derived >::diagonalize ( ) const
inline
Returns
this as a diagonal 1D expression (work only with vector/point/diagonal expressions).

Definition at line 507 of file STK_ExprBase.h.

◆ dot()

template<class Lhs >
template<class Rhs >
hidden::Promote< typenamehidden::Traits< Lhs >::Type, typenameRhs::Type >::result_type const STK::ExprBase< Lhs >::dot ( ExprBase< Rhs > const other) const
inline
Returns
the dot product of this with other.
See also
norm2(), norm(), DotProduct

Definition at line 46 of file STK_ExprBaseDot.h.

47{
48 typedef typename hidden::Traits<Rhs>::Type RType;
51 return BinaryOperator< ProductOp<Type, RType >, Lhs, Rhs>(this->asDerived(), other.asDerived()).sum();
52}
#define STK_STATIC_ASSERT_POINT_OR_VECTOR_ONLY(EXPR)
#define STK_STATIC_ASSERT_ONE_DIMENSION_ONLY(EXPR)
Type const sum() const

References STK_STATIC_ASSERT_ONE_DIMENSION_ONLY, STK_STATIC_ASSERT_POINT_OR_VECTOR_ONLY, and STK::sum().

Referenced by STK::Kmm_s::run().

◆ dotSafe()

template<class Lhs >
template<class Rhs >
hidden::Promote< typenamehidden::Traits< Lhs >::Type, typenameRhs::Type >::result_type const STK::ExprBase< Lhs >::dotSafe ( ExprBase< Rhs > const other) const
inline
Returns
the safe dot product of this with other.
See also
squaredNorm(), norm(), DotProduct

Definition at line 58 of file STK_ExprBaseDot.h.

59{
60 typedef typename hidden::Traits<Rhs>::Type RType;
63 return BinaryOperator< ProductOp<Type, RType>, Lhs, Rhs>(this->asDerived(), other.asDerived()).sumSafe();
64}
Type const sumSafe() const

References STK_STATIC_ASSERT_ONE_DIMENSION_ONLY, and STK_STATIC_ASSERT_POINT_OR_VECTOR_ONLY.

◆ exp()

template<class Derived >
UnaryOperator< ExpOp< Type >, Derived > STK::ExprBase< Derived >::exp ( ) const
inline
Returns
an expression of the exponential of this.

Definition at line 378 of file STK_ExprBase.h.

◆ funct0()

template<class Derived >
template<template< typename > class OtherOperator>
UnaryOperator< OtherOperator< Type >, Derived > const STK::ExprBase< Derived >::funct0 ( ) const
inline
Returns
an expression of funct0 to this.

Definition at line 496 of file STK_ExprBase.h.

497 { return UnaryOperator<OtherOperator<Type>, Derived>(this->asDerived());}

◆ funct1()

template<class Derived >
template<template< typename > class OtherOperator>
UnaryOperator< OtherOperator< Type >, Derived > const STK::ExprBase< Derived >::funct1 ( Type const  value) const
inline
Returns
an expression of funct1 to this.

Definition at line 500 of file STK_ExprBase.h.

501 { return UnaryOperator<OtherOperator<Type>, Derived>(this->asDerived(), OtherOperator<Type>(value));}

◆ getDiagonal()

template<class Derived >
DiagonalGetterOperator< Derived > const STK::ExprBase< Derived >::getDiagonal ( ) const
inline
Returns
the diagonal of this square expression (work only with square expressions).

Definition at line 509 of file STK_ExprBase.h.

◆ icdf()

template<class Derived >
UnaryOperator< Law::IcdfOp< Type >, Derived > STK::ExprBase< Derived >::icdf ( Law::IUnivLaw< Type > const law) const
inline

compute inverse cumulative distribution function using distribution law given by user

Definition at line 490 of file STK_ExprBase.h.

491 { return UnaryOperator<Law::IcdfOp<Type>, Derived>(this->asDerived(), Law::IcdfOp<Type>(law));}

Referenced by main().

◆ inverse()

template<class Derived >
UnaryOperator< InverseOp< Type >, Derived > STK::ExprBase< Derived >::inverse ( ) const
inline
Returns
an expression of the inverse of this.

Definition at line 394 of file STK_ExprBase.h.

◆ isFinite()

template<class Derived >
UnaryOperator< IsFiniteOp< Type >, Derived > STK::ExprBase< Derived >::isFinite ( ) const
inline
Returns
which values of this are finite value

Definition at line 372 of file STK_ExprBase.h.

◆ isInfinite()

template<class Derived >
UnaryOperator< IsInfiniteOp< Type >, Derived > STK::ExprBase< Derived >::isInfinite ( ) const
inline
Returns
which values of this are infinite value

Definition at line 374 of file STK_ExprBase.h.

Referenced by STK::IMixtureComposer::eStep(), and STK::IMixtureLearner::mapStep().

◆ isNA()

template<class Derived >
UnaryOperator< IsNaOp< Type >, Derived > STK::ExprBase< Derived >::isNA ( ) const
inline
Returns
which values of this is a NA value

Definition at line 368 of file STK_ExprBase.h.

Referenced by main(), and STK::MixtureSemiLearner::setLabels().

◆ lcdf()

template<class Derived >
UnaryOperator< Law::LogCdfOp< Type >, Derived > STK::ExprBase< Derived >::lcdf ( Law::IUnivLaw< Type > const law) const
inline

compute log-cumulative distribution function of this using distribution law given by user

Definition at line 481 of file STK_ExprBase.h.

482 { return UnaryOperator<Law::LogCdfOp<Type>, Derived>(this->asDerived(), Law::LogCdfOp<Type>(law));}

Referenced by main().

◆ lcdfc()

template<class Derived >
UnaryOperator< Law::LogCdfcOp< Type >, Derived > STK::ExprBase< Derived >::lcdfc ( Law::IUnivLaw< Type > const law) const
inline

compute complementary cumulative distribution function of this using distribution law given by user

Definition at line 487 of file STK_ExprBase.h.

488 { return UnaryOperator<Law::LogCdfcOp<Type>, Derived>(this->asDerived(), Law::LogCdfcOp<Type>(law));}

Referenced by main().

◆ log()

template<class Derived >
UnaryOperator< LogOp< Type >, Derived > STK::ExprBase< Derived >::log ( ) const
inline
Returns
an expression of the logarithm of this.

Definition at line 380 of file STK_ExprBase.h.

◆ lowerSymmetrize()

template<class Derived >
LowerSymmetrizeOperator< Derived > const STK::ExprBase< Derived >::lowerSymmetrize ( ) const
inline
Returns
the lower part of this symmetric expression (work only with square expressions).

Definition at line 519 of file STK_ExprBase.h.

◆ lowerTriangularize()

template<class Derived >
LowerTriangularizeOperator< Derived > const STK::ExprBase< Derived >::lowerTriangularize ( ) const
inline
Returns
the lower triangular part of this expression.

Definition at line 513 of file STK_ExprBase.h.

◆ lpdf()

template<class Derived >
UnaryOperator< Law::LogPdfOp< Type >, Derived > STK::ExprBase< Derived >::lpdf ( Law::IUnivLaw< Type > const law) const
inline

compute log-pdf values to this using distribution law given by user

Definition at line 475 of file STK_ExprBase.h.

476 { return UnaryOperator<Law::LogPdfOp<Type>, Derived>(this->asDerived(), Law::LogPdfOp<Type>(law));}

Referenced by main().

◆ max() [1/2]

template<class Derived >
template<typename Rhs >
hidden::OperatorSelector< Derived, Rhs, Arrays::maxOp_ >::Result const STK::ExprBase< Derived >::max ( ExprBase< Rhs > const other) const
inline
Returns
an expression with the max of this and other.

Definition at line 65 of file STK_ExprBaseOperators.h.

◆ max() [2/2]

template<class Derived >
UnaryOperator< MaxWithOp< Type >, Derived > STK::ExprBase< Derived >::max ( Type const value) const
inline
Returns
an expression of the maximum of this and a value.

Definition at line 417 of file STK_ExprBase.h.

◆ maxElt() [1/3]

template<typename Derived >
hidden::Traits< Derived >::Type const STK::ExprBase< Derived >::maxElt ( ) const
inline
Returns
the maximum of all elements of this using a Visitor.
See also
minElt(row, col), visitor()

Definition at line 197 of file STK_ExprBaseVisitor.h.

198{
199 typedef hidden::MaxVisitor<Type> Visitor;
200 Visitor visitor;
201 return visit(visitor);
202}

◆ maxElt() [2/3]

template<typename Derived >
hidden::Traits< Derived >::Type const STK::ExprBase< Derived >::maxElt ( int pos) const
inline
Returns
the maximum of all elements of this using a Visitor and puts in pos its location.
Note
Have to be used for col-vector, row-vector or diagonal matrix only.
See also
minElt(), visitor()

Definition at line 163 of file STK_ExprBaseVisitor.h.

164{
165 typedef hidden::MaxEltVisitor<Type> Visitor;
166 Visitor visitor;
167 visit(visitor);
168 idx = hidden::GetIdx<Visitor, hidden::Traits<Derived>::structure_ >::idx(visitor);
169 return visitor.result();
170}

◆ maxElt() [3/3]

template<typename Derived >
hidden::Traits< Derived >::Type const STK::ExprBase< Derived >::maxElt ( int row,
int col 
) const
inline
Returns
the maximum of all elements of this using a Visitor and puts in (row, col) its location.
See also
minElt(), visitor()

Definition at line 122 of file STK_ExprBaseVisitor.h.

123{
124 typedef hidden::MaxEltVisitor<Type> Visitor;
125 Visitor visitor;
126 visit(visitor);
127 row = visitor.row_;
128 col = visitor.col_;
129 return visitor.result();
130}
RowOperator< Derived > const row(int i) const
ColOperator< Derived > const col(int j) const

Referenced by STK::IMixtureComposer::eStep(), main(), and STK::IMixtureLearner::mapStep().

◆ maxEltSafe() [1/3]

template<typename Derived >
hidden::Traits< Derived >::Type const STK::ExprBase< Derived >::maxEltSafe ( ) const
inline
Returns
the maximum of all elements of this using a Visitor
See also
minElt(row, pos), visitor()

Definition at line 204 of file STK_ExprBaseVisitor.h.

205{
206 typedef hidden::MaxSafeVisitor<Type> Visitor;
207 Visitor visitor;
208 return visit(visitor);
209}

◆ maxEltSafe() [2/3]

template<typename Derived >
hidden::Traits< Derived >::Type const STK::ExprBase< Derived >::maxEltSafe ( int pos) const
inline
Returns
the maximum of all elements of this using a Visitor and puts in pos its location.
Note
Have to be used for col-vector, row-vector or diagonal matrix only.
See also
minElt(), visitor()

Definition at line 172 of file STK_ExprBaseVisitor.h.

173{
174 typedef hidden::MaxEltSafeVisitor<Type> Visitor;
175 Visitor visitor;
176 visit(visitor);
177 idx = hidden::GetIdx<Visitor, hidden::Traits<Derived>::structure_ >::idx(visitor);
178 return visitor.result();
179}

◆ maxEltSafe() [3/3]

template<typename Derived >
hidden::Traits< Derived >::Type const STK::ExprBase< Derived >::maxEltSafe ( int row,
int col 
) const
inline
Returns
the maximum of all elements of this using a Visitor and puts in (row, col) its location.
See also
minElt(), visitor()

Definition at line 133 of file STK_ExprBaseVisitor.h.

134{
135 typedef hidden::MaxEltSafeVisitor<Type> Visitor;
136 Visitor visitor;
137 visit(visitor);
138 row = visitor.row_;
139 col = visitor.col_;
140 return visitor.result();
141}

◆ mean()

template<typename Derived >
hidden::Traits< Derived >::Type const STK::ExprBase< Derived >::mean ( ) const
inline
Returns
the mean of all the elements of this

Definition at line 248 of file STK_ExprBaseVisitor.h.

249{
250 hidden::MeanVisitor<Type> visitor;
251 return visit(visitor);
252}

◆ meanSafe()

template<typename Derived >
hidden::Traits< Derived >::Type const STK::ExprBase< Derived >::meanSafe ( ) const
inline
Returns
safely the mean of all the elements of this

Definition at line 255 of file STK_ExprBaseVisitor.h.

256{
257 hidden::MeanSafeVisitor<Type> visitor;
258 return visit(visitor);
259}

◆ min() [1/2]

template<class Derived >
template<typename Rhs >
hidden::OperatorSelector< Derived, Rhs, Arrays::minOp_ >::Result const STK::ExprBase< Derived >::min ( ExprBase< Rhs > const other) const
inline
Returns
an expression with the min of this and other.

Definition at line 64 of file STK_ExprBaseOperators.h.

◆ min() [2/2]

template<class Derived >
UnaryOperator< MinWithOp< Type >, Derived > STK::ExprBase< Derived >::min ( Type const value) const
inline
Returns
an expression of the minimum of this and a value.

Definition at line 415 of file STK_ExprBase.h.

◆ minElt() [1/3]

template<typename Derived >
hidden::Traits< Derived >::Type const STK::ExprBase< Derived >::minElt ( ) const
inline
Returns
the minimum of all elements of this using a Visitor.
See also
maxElt(row, col), visitor()

Definition at line 182 of file STK_ExprBaseVisitor.h.

183{
184 typedef hidden::MinVisitor<Type> Visitor;
185 Visitor visitor;
186 return visit(visitor);
187}

◆ minElt() [2/3]

template<typename Derived >
hidden::Traits< Derived >::Type const STK::ExprBase< Derived >::minElt ( int pos) const
inline
Returns
the minimum of all elements of this using a Visitor and puts in pos its location.
Note
Have to be used for col-vector, row-vector or diagonal matrix only.
See also
maxElt(), visitor()

Definition at line 144 of file STK_ExprBaseVisitor.h.

145{
146 typedef hidden::MinEltVisitor<Type> Visitor;
147 Visitor visitor;
148 visit(visitor);
149 idx = hidden::GetIdx<Visitor, hidden::Traits<Derived>::structure_ >::idx(visitor);
150 return visitor.result();
151}

◆ minElt() [3/3]

template<typename Derived >
hidden::Traits< Derived >::Type const STK::ExprBase< Derived >::minElt ( int row,
int col 
) const
inline
Returns
the minimum of all elements of this using a Visitor and puts in (row, col) its location.
See also
maxElt(int,int), visitor(), minElt()

Definition at line 101 of file STK_ExprBaseVisitor.h.

102{
103 hidden::MinEltVisitor<Type> visitor;
104 visit(visitor);
105 row = visitor.row_;
106 col = visitor.col_;
107 return visitor.result();
108}

Referenced by STK::IMixtureComposer::cStep(), STK::MixtureSemiLearner::cStep(), STK::IMixtureComposer::eStep(), STK::MixtureSemiLearner::eStep(), main(), STK::IMixtureComposer::randomTik(), and STK::MixtureSemiLearner::randomTik().

◆ minEltSafe() [1/3]

template<typename Derived >
hidden::Traits< Derived >::Type const STK::ExprBase< Derived >::minEltSafe ( ) const
inline
Returns
the minimum of all elements of this using a Visitor
See also
maxElt(row, pos), visitor()

Definition at line 189 of file STK_ExprBaseVisitor.h.

190{
191 typedef hidden::MinSafeVisitor<Type> Visitor;
192 Visitor visitor;
193 return visit(visitor);
194}

◆ minEltSafe() [2/3]

template<typename Derived >
hidden::Traits< Derived >::Type const STK::ExprBase< Derived >::minEltSafe ( int pos) const
inline
Returns
the minimum of all elements of this using a Visitor and puts in pos its location.
Note
Have to be used for col-vector, row-vector or diagonal matrix only.
See also
maxElt(), visitor()

Definition at line 153 of file STK_ExprBaseVisitor.h.

154{
155 typedef hidden::MinEltSafeVisitor<Type> Visitor;
156 Visitor visitor;
157 visit(visitor);
158 idx = hidden::GetIdx<Visitor, hidden::Traits<Derived>::structure_ >::idx(visitor);
159 return visitor.result();
160}

◆ minEltSafe() [3/3]

template<typename Derived >
hidden::Traits< Derived >::Type const STK::ExprBase< Derived >::minEltSafe ( int row,
int col 
) const
inline
Returns
the minimum of all elements of *this which are not NA values using a Visitor and puts in (row, col) its location.
See also
maxEltSafe(int, int), visitor(), minElt()

Definition at line 111 of file STK_ExprBaseVisitor.h.

112{
113 typedef hidden::MinEltSafeVisitor<Type> Visitor;
114 Visitor visitor;
115 visit(visitor);
116 row = visitor.row_;
117 col = visitor.col_;
118 return visitor.result();
119}

◆ nbAvailableValues()

template<typename Derived >
int STK::ExprBase< Derived >::nbAvailableValues ( ) const
inline
Returns
the value of available values in the array (not count NA values).

Definition at line 96 of file STK_ExprBaseVisitor.h.

97{ return isFinite().count();}
UnaryOperator< IsFiniteOp< Type >, Derived > isFinite() const

References STK::isFinite().

◆ neg()

template<class Derived >
UnaryOperator< NegOp< Type >, Derived > STK::ExprBase< Derived >::neg ( ) const
inline
Returns
not of the values

Definition at line 370 of file STK_ExprBase.h.

◆ norm()

template<typename Derived >
hidden::Traits< Derived >::Type const STK::ExprBase< Derived >::norm ( ) const
inline
Returns
the norm of this

Definition at line 229 of file STK_ExprBaseVisitor.h.

230{ return Type(std::sqrt(norm2()));}
hidden::Traits< Derived >::Type Type
Type const norm2() const

◆ norm2()

template<typename Derived >
hidden::Traits< Derived >::Type const STK::ExprBase< Derived >::norm2 ( ) const
inline
Returns
the square norm of this

Definition at line 236 of file STK_ExprBaseVisitor.h.

237{ return square().sum();}
UnaryOperator< SquareOp< Type >, Derived > square() const

◆ norm2Safe()

template<typename Derived >
hidden::Traits< Derived >::Type const STK::ExprBase< Derived >::norm2Safe ( ) const
inline
Returns
the square norm of this

Definition at line 239 of file STK_ExprBaseVisitor.h.

240{ return safe().square().sum();}
UnaryOperator< SafeOp< Type >, Derived > const safe(Type const value=Type()) const

◆ normInf()

template<typename Derived >
hidden::Traits< Derived >::Type const STK::ExprBase< Derived >::normInf ( ) const
inline
Returns
the infinite norm of this

Definition at line 243 of file STK_ExprBaseVisitor.h.

244{ return abs().maxElt();}
UnaryOperator< AbsOp< Type >, Derived > abs() const

◆ normSafe()

template<typename Derived >
hidden::Traits< Derived >::Type const STK::ExprBase< Derived >::normSafe ( ) const
inline
Returns
the norm of this

Definition at line 232 of file STK_ExprBaseVisitor.h.

233{ return static_cast<Type>(std::sqrt(safe().norm2()));}

◆ operator!=() [1/2]

template<class Derived >
template<typename Rhs >
hidden::OperatorSelector< Derived, Rhs, Arrays::notEqualOp_ >::Result const STK::ExprBase< Derived >::operator!= ( ExprBase< Rhs > const other) const
inline
Returns
an expression with != operator of this and other.

Definition at line 52 of file STK_ExprBaseOperators.h.

◆ operator!=() [2/2]

template<class Derived >
UnaryOperator< NotEqualWithOp< Type >, Derived > STK::ExprBase< Derived >::operator!= ( Type const value) const
inline
Returns
an expression of *this != value.

Definition at line 404 of file STK_ExprBase.h.

◆ operator%() [1/2]

template<class Derived >
template<typename Rhs >
hidden::OperatorSelector< Derived, Rhs, Arrays::moduloOp_ >::Result const STK::ExprBase< Derived >::operator% ( ExprBase< Rhs > const other) const
inline
Returns
an expression with the modulo of this and other.

Definition at line 62 of file STK_ExprBaseOperators.h.

◆ operator%() [2/2]

template<class Derived >
UnaryOperator< ModuloWithOp< Type >, Derived > STK::ExprBase< Derived >::operator% ( Type const value) const
inline
Returns
an expression of this modulo a value

Definition at line 428 of file STK_ExprBase.h.

◆ operator&() [1/2]

template<class Derived >
template<typename Rhs >
hidden::OperatorSelector< Derived, Rhs, Arrays::bitwiseAndOp_ >::Result const STK::ExprBase< Derived >::operator& ( ExprBase< Rhs > const other) const
inline
Returns
an expression with the bitwise AND of this and other.

Definition at line 70 of file STK_ExprBaseOperators.h.

◆ operator&() [2/2]

template<class Derived >
UnaryOperator< BitwiseAndWithOp< Type >, Derived > STK::ExprBase< Derived >::operator& ( Type const value) const
inline
Returns
a bitwise expression of this AND a value

Definition at line 436 of file STK_ExprBase.h.

◆ operator&&() [1/2]

template<class Derived >
template<typename Rhs >
hidden::OperatorSelector< Derived, Rhs, Arrays::logicalAndOp_ >::Result const STK::ExprBase< Derived >::operator&& ( ExprBase< Rhs > const other) const
inline
Returns
an expression with the logical AND of this and other.

Definition at line 67 of file STK_ExprBaseOperators.h.

◆ operator&&() [2/2]

template<class Derived >
UnaryOperator< LogicalAndWithOp< Type >, Derived > STK::ExprBase< Derived >::operator&& ( Type const value) const
inline
Returns
a logical expression of this AND a value

Definition at line 431 of file STK_ExprBase.h.

◆ operator*() [1/2]

template<typename Derived >
template<typename Rhs >
hidden::ProductSelector< Derived, Rhs, hidden::Traits< Derived >::structure_, hidden::Traits< Rhs >::structure_ >::ProductType const STK::ExprBase< Derived >::operator* ( ExprBase< Rhs > const other) const
inline
Returns
the matrix multiplication of this with other.

Definition at line 163 of file STK_ExprBaseProduct.h.

164{
165 enum
166 {
167 rhs_structure_ = hidden::Traits<Rhs>::structure_,
168 productSizeIsValid_ =( sizeCols_ == UnknownSize
169 || hidden::Traits<Rhs>::sizeRows_ == UnknownSize
170 || int(sizeCols_) == int(hidden::Traits<Rhs>::sizeRows_)
171 ),
172 areVectors_ = ( structure_ == int(Arrays::vector_)
173 && hidden::Traits<Rhs>::structure_ == int(Arrays::vector_)),
174 arePoints_ = ( structure_ == int(Arrays::point_)
175 && hidden::Traits<Rhs>::structure_ == int(Arrays::point_)),
176 haveSameSizeRows_ = ( sizeRows_ == UnknownSize
177 || hidden::Traits<Rhs>::sizeRows_ == UnknownSize
178 || int(sizeRows_) == int(hidden::Traits<Rhs>::sizeRows_)
179 ),
180 haveSameSizeCols_ = ( sizeCols_ == UnknownSize
181 || hidden::Traits<Rhs>::sizeCols_ == UnknownSize
182 || int(sizeCols_) == int(hidden::Traits<Rhs>::sizeCols_)
183 )
184 };
186
187 STK_STATIC_ASSERT(productSizeIsValid_ || !(areVectors_ && haveSameSizeRows_),INVALID_VECTOR_VECTOR_PRODUCT);
188 STK_STATIC_ASSERT(productSizeIsValid_ || !(arePoints_ && haveSameSizeCols_),INVALID_POINT_POINT_PRODUCT);
189
190 return ProductType(this->asDerived(), other.asDerived());
191}
#define STK_STATIC_ASSERT(COND, MSG)
@ point_
row oriented vector/array/expression
@ vector_
column oriented vector/array/expression
const int UnknownSize
This value means that an integer is not known at compile-time, and that instead the value is stored i...
ArrayByArrayProduct< Lhs, Rhs > ProductType

References STK::Arrays::point_, STK_STATIC_ASSERT, STK::UnknownSize, and STK::Arrays::vector_.

◆ operator*() [2/2]

template<class Derived >
UnaryOperator< ProductWithOp< Type >, Derived > STK::ExprBase< Derived >::operator* ( Type const value) const
inline
Returns
an expression of this * value

Definition at line 424 of file STK_ExprBase.h.

◆ operator+() [1/2]

template<class Derived >
template<typename Rhs >
hidden::OperatorSelector< Derived, Rhs, Arrays::sumOp_ >::Result const STK::ExprBase< Derived >::operator+ ( ExprBase< Rhs > const other) const
inline
Returns
an expression with the addition of this and other.

Definition at line 58 of file STK_ExprBaseOperators.h.

◆ operator+() [2/2]

template<class Derived >
UnaryOperator< SumWithOp< Type >, Derived > STK::ExprBase< Derived >::operator+ ( Type const value) const
inline
Returns
an expression of this + value

Definition at line 420 of file STK_ExprBase.h.

◆ operator-() [1/3]

template<class Derived >
UnaryOperator< OppositeOp< Type >, Derived > STK::ExprBase< Derived >::operator- ( ) const
inline
Returns
an expression of the opposite of this

Definition at line 366 of file STK_ExprBase.h.

◆ operator-() [2/3]

template<class Derived >
template<typename Rhs >
hidden::OperatorSelector< Derived, Rhs, Arrays::differenceOp_ >::Result const STK::ExprBase< Derived >::operator- ( ExprBase< Rhs > const other) const
inline
Returns
an expression from the difference of this and other.

Definition at line 59 of file STK_ExprBaseOperators.h.

◆ operator-() [3/3]

template<class Derived >
UnaryOperator< DifferenceWithOp< Type >, Derived > STK::ExprBase< Derived >::operator- ( Type const value) const
inline
Returns
an expression of this - value

Definition at line 422 of file STK_ExprBase.h.

◆ operator/() [1/2]

template<class Derived >
template<typename Rhs >
hidden::OperatorSelector< Derived, Rhs, Arrays::divisionOp_ >::Result const STK::ExprBase< Derived >::operator/ ( ExprBase< Rhs > const other) const
inline
Returns
an expression with the quotient of this and other.

Definition at line 61 of file STK_ExprBaseOperators.h.

◆ operator/() [2/2]

template<class Derived >
UnaryOperator< DivisionWithOp< Type >, Derived > STK::ExprBase< Derived >::operator/ ( Type const value) const
inline
Returns
an expression of this divided by a value

Definition at line 426 of file STK_ExprBase.h.

◆ operator<() [1/2]

template<class Derived >
template<typename Rhs >
hidden::OperatorSelector< Derived, Rhs, Arrays::lessThanOp_ >::Result const STK::ExprBase< Derived >::operator< ( ExprBase< Rhs > const other) const
inline
Returns
an expression with < operator of this and other

Definition at line 54 of file STK_ExprBaseOperators.h.

◆ operator<() [2/2]

template<class Derived >
UnaryOperator< LessThanOp< Type >, Derived > STK::ExprBase< Derived >::operator< ( Type const value) const
inline
Returns
an expression of *this < value.

Definition at line 406 of file STK_ExprBase.h.

◆ operator<=() [1/2]

template<class Derived >
template<typename Rhs >
hidden::OperatorSelector< Derived, Rhs, Arrays::lessThanOrEqualOp_ >::Result const STK::ExprBase< Derived >::operator<= ( ExprBase< Rhs > const other) const
inline
Returns
an expression with <= operator of this and other.

Definition at line 56 of file STK_ExprBaseOperators.h.

◆ operator<=() [2/2]

template<class Derived >
UnaryOperator< LeqThanOp< Type >, Derived > STK::ExprBase< Derived >::operator<= ( Type const value) const
inline
Returns
an expression of *this <= value.

Definition at line 406 of file STK_ExprBase.h.

◆ operator==() [1/2]

template<class Derived >
template<typename Rhs >
hidden::OperatorSelector< Derived, Rhs, Arrays::equalOp_ >::Result const STK::ExprBase< Derived >::operator== ( ExprBase< Rhs > const other) const
inline
Returns
an expression with == operator of this and other.

Definition at line 51 of file STK_ExprBaseOperators.h.

◆ operator==() [2/2]

template<class Derived >
UnaryOperator< EqualWithOp< Type >, Derived > STK::ExprBase< Derived >::operator== ( Type const value) const
inline
Returns
an expression of *this == value.

Definition at line 402 of file STK_ExprBase.h.

◆ operator>() [1/2]

template<class Derived >
template<typename Rhs >
hidden::OperatorSelector< Derived, Rhs, Arrays::greaterThanOp_ >::Result const STK::ExprBase< Derived >::operator> ( ExprBase< Rhs > const other) const
inline
Returns
an expression with > operator of this and other.

Definition at line 53 of file STK_ExprBaseOperators.h.

◆ operator>() [2/2]

template<class Derived >
UnaryOperator< GreaterThanOp< Type >, Derived > STK::ExprBase< Derived >::operator> ( Type const value) const
inline
Returns
an expression of *this > value.

Definition at line 406 of file STK_ExprBase.h.

◆ operator>=() [1/2]

template<class Derived >
template<typename Rhs >
hidden::OperatorSelector< Derived, Rhs, Arrays::greaterThanOrEqualOp_ >::Result const STK::ExprBase< Derived >::operator>= ( ExprBase< Rhs > const other) const
inline
Returns
an expression with >= operator of this and other.

Definition at line 55 of file STK_ExprBaseOperators.h.

◆ operator>=() [2/2]

template<class Derived >
UnaryOperator< GeqThanOp< Type >, Derived > STK::ExprBase< Derived >::operator>= ( Type const value) const
inline
Returns
the expression of *this >= value.

Definition at line 412 of file STK_ExprBase.h.

◆ operator^() [1/2]

template<class Derived >
template<typename Rhs >
hidden::OperatorSelector< Derived, Rhs, Arrays::bitwiseXorOp_ >::Result const STK::ExprBase< Derived >::operator^ ( ExprBase< Rhs > const other) const
inline
Returns
an expression with the bitwise XOR of this and other.

Definition at line 72 of file STK_ExprBaseOperators.h.

◆ operator^() [2/2]

template<class Derived >
UnaryOperator< BitwiseXorWithOp< Type >, Derived > STK::ExprBase< Derived >::operator^ ( Type const value) const
inline
Returns
a bitwise expression of this OR a value

Definition at line 440 of file STK_ExprBase.h.

◆ operator|() [1/2]

template<class Derived >
template<typename Rhs >
hidden::OperatorSelector< Derived, Rhs, Arrays::bitwiseOrOp_ >::Result const STK::ExprBase< Derived >::operator| ( ExprBase< Rhs > const other) const
inline
Returns
an expression with the bitwise OR of this and other.

Definition at line 71 of file STK_ExprBaseOperators.h.

◆ operator|() [2/2]

template<class Derived >
UnaryOperator< BitwiseOrWithOp< Type >, Derived > STK::ExprBase< Derived >::operator| ( Type const value) const
inline
Returns
a bitwise expression of this OR a value

Definition at line 438 of file STK_ExprBase.h.

◆ operator||() [1/2]

template<class Derived >
template<typename Rhs >
hidden::OperatorSelector< Derived, Rhs, Arrays::logicalOrOp_ >::Result const STK::ExprBase< Derived >::operator|| ( ExprBase< Rhs > const other) const
inline
Returns
an expression with the logical OR of this and other.

Definition at line 68 of file STK_ExprBaseOperators.h.

◆ operator||() [2/2]

template<class Derived >
UnaryOperator< LogicalOrWithOp< Type >, Derived > STK::ExprBase< Derived >::operator|| ( Type const value) const
inline
Returns
a logical expression of this OR a value

Definition at line 433 of file STK_ExprBase.h.

◆ pdf()

template<class Derived >
UnaryOperator< Law::PdfOp< Type >, Derived > STK::ExprBase< Derived >::pdf ( Law::IUnivLaw< Type > const law) const
inline

compute pdf values to this using distribution law given by user

Definition at line 472 of file STK_ExprBase.h.

473 { return UnaryOperator<Law::PdfOp<Type>, Derived>(this->asDerived(), Law::PdfOp<Type>(law));}

Referenced by main().

◆ pow()

template<class Derived >
UnaryOperator< PowOp< Type >, Derived > STK::ExprBase< Derived >::pow ( Type const value) const
inline
Returns
an expression of the power of this.

Definition at line 443 of file STK_ExprBase.h.

◆ prod()

template<class Derived >
template<typename Rhs >
hidden::OperatorSelector< Derived, Rhs, Arrays::productOp_ >::Result const STK::ExprBase< Derived >::prod ( ExprBase< Rhs > const other) const
inline
Returns
an expression with the product (element by element) of this and other.

Definition at line 60 of file STK_ExprBaseOperators.h.

Referenced by STK::Kmm_s::randomInit(), STK::Kmm_sk::randomInit(), STK::Kmm_s::run(), and STK::Kmm_sk::run().

◆ row() [1/2]

template<class Derived >
RowOperator< Derived > const STK::ExprBase< Derived >::row ( int  i) const
inline
Returns
the i-th row of this.

Definition at line 534 of file STK_ExprBase.h.

535 { return RowOperator<Derived> (this->asDerived(), i);}

◆ row() [2/2]

template<class Derived >
template<int Size_>
SubOperator< Derived, Size_, sizeCols_ > const STK::ExprBase< Derived >::row ( TRange< Size_ > const I) const
inline
Returns
the range I of rows of this.

Definition at line 542 of file STK_ExprBase.h.

543 { return SubOperator<Derived, Size_, sizeCols_> (this->asDerived(), I, this->cols());}

◆ safe()

template<class Derived >
UnaryOperator< SafeOp< Type >, Derived > const STK::ExprBase< Derived >::safe ( Type const  value = Type()) const
inline
Returns
a safe value of this

Definition at line 448 of file STK_ExprBase.h.

449 { return UnaryOperator<SafeOp<Type>, Derived>(this->asDerived(), SafeOp<Type>(value)); }

◆ safeInverse()

template<class Derived >
UnaryOperator< SafeInverseOp< Type >, Derived > STK::ExprBase< Derived >::safeInverse ( Type const value) const
inline
Returns
an expression of this divided by the value

Definition at line 445 of file STK_ExprBase.h.

◆ sin()

template<class Derived >
UnaryOperator< SinOp< Type >, Derived > STK::ExprBase< Derived >::sin ( ) const
inline
Returns
an expression of the sine of this.

Definition at line 386 of file STK_ExprBase.h.

◆ sqrt()

template<class Derived >
UnaryOperator< SqrtOp< Type >, Derived > STK::ExprBase< Derived >::sqrt ( ) const
inline
Returns
an expression of the square root of this.

Definition at line 382 of file STK_ExprBase.h.

Referenced by main().

◆ square()

template<class Derived >
UnaryOperator< SquareOp< Type >, Derived > STK::ExprBase< Derived >::square ( ) const
inline
Returns
an expression of the square of this.

Definition at line 396 of file STK_ExprBase.h.

◆ sub() [1/2]

template<class Derived >
template<int Size_>
SubVectorOperator< Derived, Size_ > const STK::ExprBase< Derived >::sub ( TRange< Size_ > const I) const
inline
Returns
the sub-vector(I) of this.

Definition at line 524 of file STK_ExprBase.h.

525 {
527 return SubVectorOperator<Derived, Size_>(this->asDerived(), I);
528 }

References STK_STATIC_ASSERT_ONE_DIMENSION_ONLY.

◆ sub() [2/2]

template<class Derived >
template<int SizeRows_, int SizeCols_>
SubOperator< Derived, SizeRows_, SizeCols_ > const STK::ExprBase< Derived >::sub ( TRange< SizeRows_ > const I,
TRange< SizeCols_ > const J 
) const
inline
Returns
the sub-array(I,J) of this.

Definition at line 547 of file STK_ExprBase.h.

548 {
550 return SubOperator<Derived, SizeRows_, SizeCols_>(this->asDerived(), I, J);
551 }
#define STK_STATIC_ASSERT_TWO_DIMENSIONS_ONLY(EXPR)

References STK_STATIC_ASSERT_TWO_DIMENSIONS_ONLY.

◆ sum()

template<typename Derived >
hidden::Traits< Derived >::Type const STK::ExprBase< Derived >::sum ( ) const
inline
Returns
the sum of all the elements of this using a Visitor

Definition at line 213 of file STK_ExprBaseVisitor.h.

214{
215 hidden::SumVisitor<Type> visitor;
216 return visit(visitor);
217}

Referenced by main().

◆ sumSafe()

template<typename Derived >
hidden::Traits< Derived >::Type const STK::ExprBase< Derived >::sumSafe ( ) const
inline
Returns
safely the sum of all the elements of this

Definition at line 220 of file STK_ExprBaseVisitor.h.

221{
222 hidden::SumVisitor<Type> visitor;
223 return safe().visit(visitor);
224}

◆ symmetrize()

template<class Derived >
SymmetrizeOperator< Derived > const STK::ExprBase< Derived >::symmetrize ( ) const
inline
Returns
this as a symmetric expression (work only with square expressions).

Definition at line 515 of file STK_ExprBase.h.

◆ tan()

template<class Derived >
UnaryOperator< TanOp< Type >, Derived > STK::ExprBase< Derived >::tan ( ) const
inline
Returns
an expression of the tan of this.

Definition at line 392 of file STK_ExprBase.h.

◆ transpose()

template<class Derived >
TransposeOperator< Derived > const STK::ExprBase< Derived >::transpose ( ) const
inline
Returns
the transposed expression of this.

Definition at line 505 of file STK_ExprBase.h.

◆ upperSymmetrize()

template<class Derived >
UpperSymmetrizeOperator< Derived > const STK::ExprBase< Derived >::upperSymmetrize ( ) const
inline
Returns
the upper part of this symmetric expression (work only with square expressions).

Definition at line 517 of file STK_ExprBase.h.

◆ upperTriangularize()

template<class Derived >
UpperTriangularizeOperator< Derived > const STK::ExprBase< Derived >::upperTriangularize ( ) const
inline
Returns
the upper triangular part of this expression.

Definition at line 511 of file STK_ExprBase.h.

◆ variance() [1/2]

template<typename Derived >
hidden::Traits< Derived >::Type const STK::ExprBase< Derived >::variance ( ) const
inline
Returns
the variance of all the elements of this

Definition at line 263 of file STK_ExprBaseVisitor.h.

264{
265 Type mu = mean();
266 return (*this-mu).square().mean();
267}
Type const mean() const

References STK::mean().

◆ variance() [2/2]

template<typename Derived >
hidden::Traits< Derived >::Type const STK::ExprBase< Derived >::variance ( Type const mean) const
inline
Returns
the variance with given mean of all the elements of this

Definition at line 277 of file STK_ExprBaseVisitor.h.

278{ return (*this-mean).square().mean();}

References STK::mean().

◆ varianceSafe() [1/2]

template<typename Derived >
hidden::Traits< Derived >::Type const STK::ExprBase< Derived >::varianceSafe ( ) const
inline
Returns
the variance of all the elements of this

Definition at line 270 of file STK_ExprBaseVisitor.h.

271{
272 Type mu = meanSafe();
273 return (*this-mu).square().meanSafe();
274}
Type const meanSafe() const

References STK::meanSafe().

◆ varianceSafe() [2/2]

template<typename Derived >
hidden::Traits< Derived >::Type const STK::ExprBase< Derived >::varianceSafe ( Type const mean) const
inline
Returns
safely the variance with given mean of all the elements of this

Definition at line 280 of file STK_ExprBaseVisitor.h.

281{ return (*this-mean).square().meanSafe();}

References STK::mean().

◆ visit()

template<typename Derived >
template<typename Visitor >
Visitor::TypeConst STK::ExprBase< Derived >::visit ( Visitor visitor) const
inline

Visit the container using a constant visitor.

Run the visitor visitor to the whole coefficients of the array.

Parameters
visitorthe visitor to run

The template parameter Visitor is the type of the visitor and provides the following interface:

struct MyVisitor {
// called for all coefficients
void operator() (Type const& value, int i, int j);
};
The MultidimRegression class allows to regress a multidimensional output variable among a multivariat...
Note
visitors offer automatic unrolling for small fixed size matrix.
See also
minElt, maxElt

Definition at line 63 of file STK_ExprBaseVisitor.h.

64{
66 Impl::run(this->asDerived(), visitor);
67 return visitor.result();
68}
If< is2D_ &&unrollRows_ &&unrollCols_, ArrayImpl, HelperImpl >::Result Impl

◆ wmean() [1/2]

template<class Derived >
template<typename Rhs >
Type const STK::ExprBase< Derived >::wmean ( ExprBase< Rhs > const weights) const
Returns
the weighted mean of all the elements of this
Note
will only work with row-vectors or col-vectors

◆ wmean() [2/2]

template<class Derived >
template<typename Rhs >
hidden::Traits< Derived >::Type const STK::ExprBase< Derived >::wmean ( ExprBase< Rhs > const weights) const
inline

Definition at line 338 of file STK_ExprBaseVisitor.h.

339{
342 Type size = weights.sum();
343 if (size <= 0 || !STK::isFinite(size)) return Arithmetic<Type>::NA();
344 return wsum(weights)/size;
345}
Type const wsum(ExprBase< Rhs > const &weights) const
bool isFinite(Type const &x)
utility method allowing to know if a value is a finite value
static Type NA()
Adding a Non Available (NA) special number.

References STK::isFinite(), STK::Arithmetic< Type >::NA(), STK_STATIC_ASSERT_ONE_DIMENSION_ONLY, and STK_STATIC_ASSERT_POINT_OR_VECTOR_ONLY.

◆ wmeanSafe() [1/2]

template<class Derived >
template<typename Rhs >
Type const STK::ExprBase< Derived >::wmeanSafe ( ExprBase< Rhs > const weights) const
Returns
the safely weighted mean of all the elements of this
Note
will only work with row-vectors or col-vectors

◆ wmeanSafe() [2/2]

template<class Derived >
template<typename Rhs >
hidden::Traits< Derived >::Type const STK::ExprBase< Derived >::wmeanSafe ( ExprBase< Rhs > const weights) const
inline

Definition at line 349 of file STK_ExprBaseVisitor.h.

350{
353 Type size = weights.sumSafe();
354 if (size <= 0) return Arithmetic<Type>::NA();
355 return wsumSafe(weights)/size;
356}
Type const wsumSafe(ExprBase< Rhs > const &weights) const

References STK::Arithmetic< Type >::NA(), STK_STATIC_ASSERT_ONE_DIMENSION_ONLY, and STK_STATIC_ASSERT_POINT_OR_VECTOR_ONLY.

◆ wnorm() [1/2]

template<class Derived >
template<typename Rhs >
Type const STK::ExprBase< Derived >::wnorm ( ExprBase< Rhs > const weights) const
Returns
the weighted norm of this
Note
will only work with row-vectors or col-vectors

◆ wnorm() [2/2]

template<class Derived >
template<typename Rhs >
hidden::Traits< Derived >::Type const STK::ExprBase< Derived >::wnorm ( ExprBase< Rhs > const weights) const
inline

Definition at line 303 of file STK_ExprBaseVisitor.h.

304{
307 return static_cast<Type>(std::sqrt(wnorm2(weights)));
308}
Type const wnorm2(ExprBase< Rhs > const &weights) const

References STK_STATIC_ASSERT_ONE_DIMENSION_ONLY, and STK_STATIC_ASSERT_POINT_OR_VECTOR_ONLY.

◆ wnorm2() [1/2]

template<class Derived >
template<typename Rhs >
Type const STK::ExprBase< Derived >::wnorm2 ( ExprBase< Rhs > const weights) const
Returns
the weighted square norm of this
Note
will only work with row-vectors or col-vectors

◆ wnorm2() [2/2]

template<class Derived >
template<typename Rhs >
hidden::Traits< Derived >::Type const STK::ExprBase< Derived >::wnorm2 ( ExprBase< Rhs > const weights) const
inline

◆ wnorm2Safe() [1/2]

template<class Derived >
template<typename Rhs >
Type const STK::ExprBase< Derived >::wnorm2Safe ( ExprBase< Rhs > const weights) const
Returns
the weighted square norm of this
Note
will only work with row-vectors or col-vectors

◆ wnorm2Safe() [2/2]

template<class Derived >
template<typename Rhs >
hidden::Traits< Derived >::Type const STK::ExprBase< Derived >::wnorm2Safe ( ExprBase< Rhs > const weights) const
inline

◆ wnormSafe() [1/2]

template<class Derived >
template<typename Rhs >
Type const STK::ExprBase< Derived >::wnormSafe ( ExprBase< Rhs > const weights) const
Returns
the weighted norm of this
Note
will only work with row-vectors or col-vectors

◆ wnormSafe() [2/2]

template<class Derived >
template<typename Rhs >
hidden::Traits< Derived >::Type const STK::ExprBase< Derived >::wnormSafe ( ExprBase< Rhs > const weights) const
inline

Definition at line 311 of file STK_ExprBaseVisitor.h.

312{
315 return static_cast<Type>(std::sqrt(wnorm2Safe(weights)));
316}
Type const wnorm2Safe(ExprBase< Rhs > const &weights) const

References STK_STATIC_ASSERT_ONE_DIMENSION_ONLY, and STK_STATIC_ASSERT_POINT_OR_VECTOR_ONLY.

◆ wsum() [1/2]

template<class Derived >
template<typename Rhs >
Type const STK::ExprBase< Derived >::wsum ( ExprBase< Rhs > const weights) const
Returns
the weighted sum of all the elements of this using a Visitor
Note
will only work with row-vectors or col-vectors

◆ wsum() [2/2]

template<class Derived >
template<typename Rhs >
hidden::Traits< Derived >::Type const STK::ExprBase< Derived >::wsum ( ExprBase< Rhs > const weights) const
inline

Definition at line 286 of file STK_ExprBaseVisitor.h.

287{
290 return dot(weights);
291}
hidden::Promote< Type, typenameRhs::Type >::result_type const dot(ExprBase< Rhs > const &other) const

References STK::dot(), STK_STATIC_ASSERT_ONE_DIMENSION_ONLY, and STK_STATIC_ASSERT_POINT_OR_VECTOR_ONLY.

◆ wsumSafe() [1/2]

template<class Derived >
template<typename Rhs >
Type const STK::ExprBase< Derived >::wsumSafe ( ExprBase< Rhs > const weights) const
Returns
the safely weighted sum of all the elements of this
Note
will only work with row-vectors or col-vectors

◆ wsumSafe() [2/2]

template<class Derived >
template<typename Rhs >
hidden::Traits< Derived >::Type const STK::ExprBase< Derived >::wsumSafe ( ExprBase< Rhs > const weights) const
inline

Definition at line 294 of file STK_ExprBaseVisitor.h.

295{
298 return dotSafe(weights);
299}
hidden::Promote< Type, typenameRhs::Type >::result_type const dotSafe(ExprBase< Rhs > const &other) const

References STK_STATIC_ASSERT_ONE_DIMENSION_ONLY, and STK_STATIC_ASSERT_POINT_OR_VECTOR_ONLY.

◆ wvariance() [1/4]

template<class Derived >
template<typename Rhs >
Type const STK::ExprBase< Derived >::wvariance ( ExprBase< Rhs > const weights) const
Returns
the weighted variance of all the elements of this
Note
will only work with row-vectors or col-vectors

◆ wvariance() [2/4]

template<class Derived >
template<typename Rhs >
hidden::Traits< Derived >::Type const STK::ExprBase< Derived >::wvariance ( ExprBase< Rhs > const weights) const
inline

Definition at line 361 of file STK_ExprBaseVisitor.h.

362{
365 Type mean = wmean(weights);
367 return (*this-mean).square().wmean(weights);
368}
Type const wmean(ExprBase< Rhs > const &weights) const

References STK::isFinite(), STK::mean(), STK::Arithmetic< Type >::NA(), STK_STATIC_ASSERT_ONE_DIMENSION_ONLY, and STK_STATIC_ASSERT_POINT_OR_VECTOR_ONLY.

◆ wvariance() [3/4]

template<class Derived >
template<typename Rhs >
Type const STK::ExprBase< Derived >::wvariance ( Type const mean,
ExprBase< Rhs > const weights 
) const
Returns
the variance with given mean of all the elements of this
Note
will only work with row-vectors or col-vectors

◆ wvariance() [4/4]

template<class Derived >
template<typename Rhs >
hidden::Traits< Derived >::Type const STK::ExprBase< Derived >::wvariance ( Type const mean,
ExprBase< Rhs > const weights 
) const
inline

Definition at line 383 of file STK_ExprBaseVisitor.h.

384{
387 return (*this-mean).square().wmean(weights);
388}

References STK::mean(), STK_STATIC_ASSERT_ONE_DIMENSION_ONLY, and STK_STATIC_ASSERT_POINT_OR_VECTOR_ONLY.

◆ wvarianceSafe() [1/4]

template<class Derived >
template<typename Rhs >
Type const STK::ExprBase< Derived >::wvarianceSafe ( ExprBase< Rhs > const weights) const
Returns
the weighted variance of all the elements of this
Note
will only work with row-vectors or col-vectors

◆ wvarianceSafe() [2/4]

template<class Derived >
template<typename Rhs >
hidden::Traits< Derived >::Type const STK::ExprBase< Derived >::wvarianceSafe ( ExprBase< Rhs > const weights) const
inline

Definition at line 371 of file STK_ExprBaseVisitor.h.

372{
375 Type mean = wmeanSafe(weights);
377 return (*this-mean).square().wmeanSafe(weights);
378}
Type const wmeanSafe(ExprBase< Rhs > const &weights) const

References STK::isFinite(), STK::mean(), STK::Arithmetic< Type >::NA(), STK_STATIC_ASSERT_ONE_DIMENSION_ONLY, and STK_STATIC_ASSERT_POINT_OR_VECTOR_ONLY.

◆ wvarianceSafe() [3/4]

template<class Derived >
template<typename Rhs >
Type const STK::ExprBase< Derived >::wvarianceSafe ( Type const mean,
ExprBase< Rhs > const weights 
) const
Returns
safely the variance with given mean of all the elements of this
Note
will only work with row-vectors or col-vectors

◆ wvarianceSafe() [4/4]

template<class Derived >
template<typename Rhs >
hidden::Traits< Derived >::Type const STK::ExprBase< Derived >::wvarianceSafe ( Type const mean,
ExprBase< Rhs > const weights 
) const
inline

Definition at line 391 of file STK_ExprBaseVisitor.h.

392{
395 return (*this-mean).square().wmeanSafe(weights);
396}

References STK::mean(), STK_STATIC_ASSERT_ONE_DIMENSION_ONLY, and STK_STATIC_ASSERT_POINT_OR_VECTOR_ONLY.

Friends And Related Symbol Documentation

◆ operator*

template<class Derived >
UnaryOperator< ProductWithOp< Type >, Derived > const operator* ( Type const  value,
ExprBase< Derived > const other 
)
friend
Returns
an expression of value * this

Definition at line 462 of file STK_ExprBase.h.

463 { return other.asDerived()*value; }

◆ operator+

template<class Derived >
UnaryOperator< SumWithOp< Type >, Derived > const operator+ ( Type const value,
ExprBase< Derived > const other 
)
friend
Returns
an expression of value + this

Definition at line 454 of file STK_ExprBase.h.

455 { return other.asDerived() + value;}

◆ operator-

template<class Derived >
UnaryOperator< SubstractToOp< Type >, Derived > const operator- ( Type const  value,
ExprBase< Derived > const other 
)
friend
Returns
an expression of value - this

Definition at line 458 of file STK_ExprBase.h.

459 { return UnaryOperator<SubstractToOp<Type>, Derived>(other.asDerived(), SubstractToOp<Type>(value));}

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