STK++ 0.9.13
STK::Stat::MaxOp< Derived > Struct Template Reference

Compute the maximal value of the variable V. More...

#include <STK_Stat_Functors.h>

Public Types

typedef Derived::Type Type
 

Public Member Functions

 MaxOp (ExprBase< Derived > const &V)
 constructor
 
Type const operator() () const
 
template<class Weights >
Type const operator() (ExprBase< Weights > const &w) const
 

Protected Attributes

Derived constV_
 

Detailed Description

template<class Derived>
struct STK::Stat::MaxOp< Derived >

Compute the maximal value of the variable V.

Definition at line 148 of file STK_Stat_Functors.h.

Member Typedef Documentation

◆ Type

template<class Derived >
typedef Derived::Type STK::Stat::MaxOp< Derived >::Type

Definition at line 150 of file STK_Stat_Functors.h.

Constructor & Destructor Documentation

◆ MaxOp()

template<class Derived >
STK::Stat::MaxOp< Derived >::MaxOp ( ExprBase< Derived > const V)
inline

constructor

Definition at line 152 of file STK_Stat_Functors.h.

152 : V_(V.asDerived())
#define STK_STATIC_ASSERT_ONE_DIMENSION_ONLY(EXPR)
Derived const & V_

References STK_STATIC_ASSERT_ONE_DIMENSION_ONLY.

Member Function Documentation

◆ operator()() [1/2]

template<class Derived >
Type const STK::Stat::MaxOp< Derived >::operator() ( ) const
inline
Returns
the maximal value of the variable V

\[ \max_{i=1}^n v_i \]

Definition at line 157 of file STK_Stat_Functors.h.

158 {
159 Type max = -Arithmetic<Type>::max();
160 for (int i=V_.begin(); i<V_.end(); i++)
161 { max = std::max(max, V_[i]);}
162 return max;
163 }
hidden::FunctorTraits< Derived, MaxOp >::Row max(Derived const &A)
Compute the maximal(s) value(s) of A.

References STK::Stat::max(), and STK::Stat::MaxOp< Derived >::V_.

◆ operator()() [2/2]

template<class Derived >
template<class Weights >
Type const STK::Stat::MaxOp< Derived >::operator() ( ExprBase< Weights > const w) const
inline
Returns
the weighted maximal value of the variable V

\[ \max_{i=1}^n w_i v_i \]

Parameters
wthe weights

Definition at line 169 of file STK_Stat_Functors.h.

170 {
172 Type max = -Arithmetic<Type>::max();
173 for (int i=V_.begin(); i<V_.end(); i++)
174 { max = std::max(max, w[i]*V_[i]);}
175 return max;
176 }

References STK::Stat::max(), STK_STATIC_ASSERT_ONE_DIMENSION_ONLY, and STK::Stat::MaxOp< Derived >::V_.

Member Data Documentation

◆ V_

template<class Derived >
Derived const& STK::Stat::MaxOp< Derived >::V_
protected

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