STK++ 0.9.13
STK::ApplyWeightedFunctorByCol< Derived, Functor > Struct Template Reference

class allowing to apply the weighted Functor Functor on each columns of an expression. More...

#include <STK_ExprBaseFunctors.h>

Public Types

enum  { sizeRows_ = Derived::sizeRows_ , sizeCols_ = Derived::sizeCols_ }
 
typedef Derived::Type Type
 
typedef CArrayPoint< Type, sizeCols_Row
 

Public Member Functions

 ApplyWeightedFunctorByCol (ExprBase< Derived > const &lhs)
 constructor
 
template<class Weights >
Row operator() (ExprBase< Weights > const &w)
 
template<class Weights >
Row operator() (ExprBase< Weights > const &w, bool option)
 
template<class Weights >
Row operator() (ExprBase< Weights > const &w, Type const &value)
 
template<class Weights , typename OtherRow >
Row operator() (ExprBase< Weights > const &w, ExprBase< OtherRow > const &value, bool option)
 

Protected Attributes

Derived constlhs_
 
Row res_
 

Detailed Description

template<typename Derived, typename Functor>
struct STK::ApplyWeightedFunctorByCol< Derived, Functor >

class allowing to apply the weighted Functor Functor on each columns of an expression.

Definition at line 182 of file STK_ExprBaseFunctors.h.

Member Typedef Documentation

◆ Row

template<typename Derived , typename Functor >
typedef CArrayPoint<Type, sizeCols_> STK::ApplyWeightedFunctorByCol< Derived, Functor >::Row

Definition at line 190 of file STK_ExprBaseFunctors.h.

◆ Type

template<typename Derived , typename Functor >
typedef Derived::Type STK::ApplyWeightedFunctorByCol< Derived, Functor >::Type

Definition at line 184 of file STK_ExprBaseFunctors.h.

Member Enumeration Documentation

◆ anonymous enum

template<typename Derived , typename Functor >
anonymous enum
Enumerator
sizeRows_ 
sizeCols_ 

Definition at line 185 of file STK_ExprBaseFunctors.h.

186 {
187 sizeRows_ = Derived::sizeRows_,
188 sizeCols_ = Derived::sizeCols_
189 };

Constructor & Destructor Documentation

◆ ApplyWeightedFunctorByCol()

template<typename Derived , typename Functor >
STK::ApplyWeightedFunctorByCol< Derived, Functor >::ApplyWeightedFunctorByCol ( ExprBase< Derived > const lhs)
inline

constructor

Definition at line 193 of file STK_ExprBaseFunctors.h.

194 : lhs_(lhs.asDerived())
195 , res_(lhs_.cols())
196 {}

Member Function Documentation

◆ operator()() [1/4]

template<typename Derived , typename Functor >
template<class Weights >
Row STK::ApplyWeightedFunctorByCol< Derived, Functor >::operator() ( ExprBase< Weights > const w)
inline

Definition at line 198 of file STK_ExprBaseFunctors.h.

199 {
200 for (int j= lhs_.beginCols(); j < lhs_.endCols(); ++j)
201 { res_[j] = Functor(lhs_.col(j))(w);}
202 return res_;
203 }

References STK::ApplyWeightedFunctorByCol< Derived, Functor >::lhs_, and STK::ApplyWeightedFunctorByCol< Derived, Functor >::res_.

◆ operator()() [2/4]

template<typename Derived , typename Functor >
template<class Weights >
Row STK::ApplyWeightedFunctorByCol< Derived, Functor >::operator() ( ExprBase< Weights > const w,
bool  option 
)
inline

Definition at line 205 of file STK_ExprBaseFunctors.h.

206 {
207 for (int j= lhs_.beginCols(); j < lhs_.endCols(); ++j)
208 { res_[j] = Functor(lhs_.col(j))(w, option);}
209 return res_;
210 }

References STK::ApplyWeightedFunctorByCol< Derived, Functor >::lhs_, and STK::ApplyWeightedFunctorByCol< Derived, Functor >::res_.

◆ operator()() [3/4]

template<typename Derived , typename Functor >
Row STK::ApplyWeightedFunctorByCol< Derived, Functor >::operator() ( ExprBase< Weights > const w,
ExprBase< OtherRow > const value,
bool  option 
)
inline

Definition at line 219 of file STK_ExprBaseFunctors.h.

220 {
221#ifdef STK_BOUNDS_CHECK
222 if (lhs_.cols() != value.range())
223 STKRUNTIME_ERROR_NO_ARG(ApplyWeightedFunctorByCol::operator(w,value,option),lhs_.cols()!=value.range());
224#endif
225 for (int j= lhs_.beginCols(); j < lhs_.endCols(); ++j)
226 { res_[j] = Functor(lhs_.col(j))(w, value[j], option);}
227 return res_;
228 }
#define STKRUNTIME_ERROR_NO_ARG(Where, Error)
Definition STK_Macros.h:138

References STK::ApplyWeightedFunctorByCol< Derived, Functor >::lhs_, STK::ApplyWeightedFunctorByCol< Derived, Functor >::res_, and STKRUNTIME_ERROR_NO_ARG.

◆ operator()() [4/4]

template<typename Derived , typename Functor >
template<class Weights >
Row STK::ApplyWeightedFunctorByCol< Derived, Functor >::operator() ( ExprBase< Weights > const w,
Type const value 
)
inline

Definition at line 212 of file STK_ExprBaseFunctors.h.

213 {
214 for (int j= lhs_.beginCols(); j < lhs_.endCols(); ++j)
215 { res_[j] = Functor(lhs_.col(j))(w, value);}
216 return res_;
217 }

References STK::ApplyWeightedFunctorByCol< Derived, Functor >::lhs_, and STK::ApplyWeightedFunctorByCol< Derived, Functor >::res_.

Member Data Documentation

◆ lhs_

◆ res_


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