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

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

#include <STK_Stat_Functors.h>

Public Types

typedef Derived::Type Type
 

Public Member Functions

 MinOp (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::MinOp< Derived >

Compute the minimal value of the variable V.

Definition at line 77 of file STK_Stat_Functors.h.

Member Typedef Documentation

◆ Type

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

Definition at line 79 of file STK_Stat_Functors.h.

Constructor & Destructor Documentation

◆ MinOp()

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

constructor

Definition at line 81 of file STK_Stat_Functors.h.

81 : 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::MinOp< Derived >::operator() ( ) const
inline
Returns
the minimal value of the variable V

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

Definition at line 86 of file STK_Stat_Functors.h.

87 {
88 Type min = Arithmetic<Type>::max();
89 for (int i=V_.begin(); i<V_.end(); i++)
90 { min = std::min(min, V_[i]);}
91 return min;
92 }
hidden::FunctorTraits< Derived, MinOp >::Row min(Derived const &A)
Compute the minimal(s) value(s) of A.

References STK::Stat::min(), and STK::Stat::MinOp< Derived >::V_.

◆ operator()() [2/2]

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

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

Parameters
wthe weights

Definition at line 98 of file STK_Stat_Functors.h.

99 {
101 Type min = Arithmetic<Type>::max();
102 for (int i=V_.begin(); i<V_.end(); i++)
103 { min = std::min(min, w[i]*V_[i]);}
104 return min;
105 }

References STK::Stat::min(), STK_STATIC_ASSERT_ONE_DIMENSION_ONLY, and STK::Stat::MinOp< Derived >::V_.

Member Data Documentation

◆ V_

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

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