STK++ 0.9.13
STK::hidden::MeanVisitor< Type_ > Struct Template Reference

Visitor computing the mean of all the coefficients of the Array. More...

#include <STK_Visitors.h>

Public Types

typedef Type_ Type
 
typedef RemoveConst< Type >::Type TypeConst
 

Public Member Functions

 MeanVisitor ()
 
void operator() (Type const &value, int i, int j)
 
void operator() (Type const &value, int i)
 
TypeConst result () const
 

Public Attributes

Type res_
 
int nb_
 

Detailed Description

template<typename Type_>
struct STK::hidden::MeanVisitor< Type_ >

Visitor computing the mean of all the coefficients of the Array.

See also
ExprBase::mean()

Definition at line 242 of file STK_Visitors.h.

Member Typedef Documentation

◆ Type

template<typename Type_ >
typedef Type_ STK::hidden::MeanVisitor< Type_ >::Type

Definition at line 244 of file STK_Visitors.h.

◆ TypeConst

template<typename Type_ >
typedef RemoveConst<Type>::Type STK::hidden::MeanVisitor< Type_ >::TypeConst

Definition at line 245 of file STK_Visitors.h.

Constructor & Destructor Documentation

◆ MeanVisitor()

template<typename Type_ >
STK::hidden::MeanVisitor< Type_ >::MeanVisitor ( )
inline

Member Function Documentation

◆ operator()() [1/2]

template<typename Type_ >
void STK::hidden::MeanVisitor< Type_ >::operator() ( Type const value,
int  i 
)
inline

Definition at line 251 of file STK_Visitors.h.

252 { res_ += value; nb_++;}

References STK::hidden::MeanVisitor< Type_ >::nb_, and STK::hidden::MeanVisitor< Type_ >::res_.

◆ operator()() [2/2]

template<typename Type_ >
void STK::hidden::MeanVisitor< Type_ >::operator() ( Type const value,
int  i,
int  j 
)
inline

Definition at line 249 of file STK_Visitors.h.

250 { res_ += value; nb_++;}

References STK::hidden::MeanVisitor< Type_ >::nb_, and STK::hidden::MeanVisitor< Type_ >::res_.

◆ result()

template<typename Type_ >
TypeConst STK::hidden::MeanVisitor< Type_ >::result ( ) const
inline

Definition at line 253 of file STK_Visitors.h.

253{ return nb_ == 0 ? Arithmetic<Type>::NA() : res_/nb_;}
static Type NA()
Adding a Non Available (NA) special number.

References STK::Arithmetic< Type >::NA(), STK::hidden::MeanVisitor< Type_ >::nb_, and STK::hidden::MeanVisitor< Type_ >::res_.

Member Data Documentation

◆ nb_

◆ res_


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