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

Visitor computing safely the max of all the coefficients of the Array. More...

#include <STK_Visitors.h>

Public Types

typedef Type_ Type
 
typedef RemoveConst< Type >::Type constTypeConst
 

Public Member Functions

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

Public Attributes

Type res_
 

Detailed Description

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

Visitor computing safely the max of all the coefficients of the Array.

See also
ExprBase::max(), ExprBase::min()

Definition at line 204 of file STK_Visitors.h.

Member Typedef Documentation

◆ Type

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

Definition at line 206 of file STK_Visitors.h.

◆ TypeConst

template<typename Type_ >
typedef RemoveConst<Type>::Type const& STK::hidden::MaxSafeVisitor< Type_ >::TypeConst

Definition at line 207 of file STK_Visitors.h.

Constructor & Destructor Documentation

◆ MaxSafeVisitor()

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

Definition at line 210 of file STK_Visitors.h.

210: res_(-Arithmetic<Type>::max()) {}

Member Function Documentation

◆ operator()() [1/2]

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

Definition at line 213 of file STK_Visitors.h.

214 { if (Arithmetic<Type>::isFinite(value)) { res_ = std::max(res_,value);}}
static bool isFinite(Type const &x)

References STK::hidden::MaxSafeVisitor< Type_ >::res_.

◆ operator()() [2/2]

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

Definition at line 211 of file STK_Visitors.h.

212 { if (Arithmetic<Type>::isFinite(value)) { res_ = std::max(res_,value);}}

References STK::hidden::MaxSafeVisitor< Type_ >::res_.

◆ result()

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

Definition at line 215 of file STK_Visitors.h.

215{ return res_;}

References STK::hidden::MaxSafeVisitor< Type_ >::res_.

Member Data Documentation

◆ res_


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