STK++ 0.9.13
STK::DotProduct< Lhs, Rhs > Class Template Reference

Generic expression where a DotProduct is applied to two expressions. More...

#include <STK_DotProduct.h>

Inheritance diagram for STK::DotProduct< Lhs, Rhs >:
Inheritance graph

Public Types

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

Public Member Functions

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

Private Attributes

Allocator result_
 

Additional Inherited Members

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

Detailed Description

template<typename Lhs, typename Rhs>
class STK::DotProduct< Lhs, Rhs >

Generic expression where a DotProduct is applied to two expressions.

Template Parameters
Lhsthe type of the left-hand side
Rhsthe type of the right-hand side

This class represents an expression where a dot product is applied to two expressions. The left hand side being a point_ (a row-oriented vector) and the right hand side a vector_ (a column-oriented vector).

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

Definition at line 84 of file STK_DotProduct.h.

Member Typedef Documentation

◆ Allocator

template<typename Lhs , typename Rhs >
typedef hidden::Traits<DotProduct>::Allocator STK::DotProduct< Lhs, Rhs >::Allocator

Definition at line 90 of file STK_DotProduct.h.

◆ ColRange

Type of the Range for the columns.

Definition at line 103 of file STK_DotProduct.h.

◆ RowRange

Type of the Range for the rows.

Definition at line 101 of file STK_DotProduct.h.

◆ Type

Definition at line 88 of file STK_DotProduct.h.

◆ TypeConst

template<typename Lhs , typename Rhs >
typedef hidden::Traits<DotProduct>::TypeConst STK::DotProduct< Lhs, Rhs >::TypeConst

Definition at line 89 of file STK_DotProduct.h.

Member Enumeration Documentation

◆ anonymous enum

Enumerator
structure_ 
orient_ 
sizeRows_ 
sizeCols_ 
storage_ 

Definition at line 92 of file STK_DotProduct.h.

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

Constructor & Destructor Documentation

◆ DotProduct()

template<typename Lhs , typename Rhs >
STK::DotProduct< Lhs, Rhs >::DotProduct ( const Lhs lhs,
const Rhs rhs 
)
inline

Definition at line 105 of file STK_DotProduct.h.

106 : lhs_(lhs), rhs_(rhs)
107 , result_()
108 {
111#ifdef STK_BOUNDS_CHECK
112 if (lhs.range() != rhs.range())
113 { STKRUNTIME_ERROR_NO_ARG(DotProduct:DotProduct, sizes mismatch between Lhs and Rhs);}
114#endif
115 result_.shift(lhs.beginRows(), rhs.beginCols());
116 result_.elt() = lhs.dot(rhs);
117 }
#define STKRUNTIME_ERROR_NO_ARG(Where, Error)
Definition STK_Macros.h:138
#define STK_STATIC_ASSERT_POINT_ONLY(EXPR)
#define STK_STATIC_ASSERT_VECTOR_ONLY(EXPR)
DotProduct(const Lhs &lhs, const Rhs &rhs)
Rhs const & rhs() const
Lhs const & lhs() const

References STK::DotProduct< Lhs, Rhs >::lhs(), STK::DotProduct< Lhs, Rhs >::result_, STK::DotProduct< Lhs, Rhs >::rhs(), STK_STATIC_ASSERT_POINT_ONLY, STK_STATIC_ASSERT_VECTOR_ONLY, and STKRUNTIME_ERROR_NO_ARG.

Member Function Documentation

◆ colsImpl()

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

Definition at line 121 of file STK_DotProduct.h.

121{ return result_.cols();}

References STK::DotProduct< Lhs, Rhs >::result_.

◆ elt0Impl()

template<typename Lhs , typename Rhs >
TypeConst STK::DotProduct< Lhs, Rhs >::elt0Impl ( ) const
inline

access to the element

Definition at line 133 of file STK_DotProduct.h.

133{ return result_.elt();}

References STK::DotProduct< Lhs, Rhs >::result_.

◆ elt2Impl()

template<typename Lhs , typename Rhs >
TypeConst STK::DotProduct< Lhs, Rhs >::elt2Impl ( int  i,
int  j 
) const
inline

access to the element

Definition at line 124 of file STK_DotProduct.h.

125 {
126#ifdef STK_BOUNDS_CHECK
127 if ( (result_.beginRows() != i) || (result_.beginCols() !=j) )
128 { STKRUNTIME_ERROR_2ARG(DotProduct:elt2Impl,i,j,wrong indexes);}
129#endif
130 return result_.elt(i, j);
131 }
#define STKRUNTIME_ERROR_2ARG(Where, Arg1, Arg2, Error)
Definition STK_Macros.h:120
TypeConst elt2Impl(int i, int j) const
access to the element

References STK::DotProduct< Lhs, Rhs >::elt2Impl(), STK::DotProduct< Lhs, Rhs >::result_, and STKRUNTIME_ERROR_2ARG.

Referenced by STK::DotProduct< Lhs, Rhs >::elt2Impl().

◆ lhs()

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

Definition at line 136 of file STK_DotProduct.h.

136{ return lhs_; }

References STK::DotProduct< Lhs, Rhs >::lhs_.

Referenced by STK::DotProduct< Lhs, Rhs >::DotProduct().

◆ result()

template<typename Lhs , typename Rhs >
Allocator const & STK::DotProduct< Lhs, Rhs >::result ( ) const
inline
Returns
the result

Definition at line 140 of file STK_DotProduct.h.

140{ return result_; }

References STK::DotProduct< Lhs, Rhs >::result_.

◆ rhs()

template<typename Lhs , typename Rhs >
Rhs const & STK::DotProduct< Lhs, Rhs >::rhs ( ) const
inline
Returns
the right hand side nested expression

Definition at line 138 of file STK_DotProduct.h.

138{ return rhs_; }

References STK::DotProduct< Lhs, Rhs >::rhs_.

Referenced by STK::DotProduct< Lhs, Rhs >::DotProduct().

◆ rowsImpl()

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

Definition at line 119 of file STK_DotProduct.h.

119{ return result_.rows();}

References STK::DotProduct< Lhs, Rhs >::result_.

Member Data Documentation

◆ lhs_

template<typename Lhs , typename Rhs >
Lhs const& STK::DotProduct< Lhs, Rhs >::lhs_
protected

Definition at line 143 of file STK_DotProduct.h.

Referenced by STK::DotProduct< Lhs, Rhs >::lhs().

◆ result_

◆ rhs_

template<typename Lhs , typename Rhs >
Rhs const& STK::DotProduct< Lhs, Rhs >::rhs_
protected

Definition at line 144 of file STK_DotProduct.h.

Referenced by STK::DotProduct< Lhs, Rhs >::rhs().


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