NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
StatsLogic Struct Reference

Simplify the creation of some statistics by externalizing the operation code and unifying the driver code. More...

#include <statslogic.hpp>

Collaboration diagram for StatsLogic:

Public Types

enum  OperationType {
  OPERATION_ADD , OPERATION_MULT , OPERATION_ADDSQ , OPERATION_ADDSQSUB ,
  OPERATION_MAX , OPERATION_MIN , OPERATION_NUM
}
 

Public Member Functions

 StatsLogic (OperationType type, double baseVal=0.0, mu::value_type compVal=0.0)
 
void operator() (const mu::value_type &newVal)
 Implements the statistics logic. More...
 
void combine (const StatsLogic &other)
 Combines results from different StatsLogic instances into a single result. More...
 

Public Attributes

mu::value_type m_val
 
mu::value_type m_compval
 
OperationType m_type
 

Detailed Description

Simplify the creation of some statistics by externalizing the operation code and unifying the driver code.

Definition at line 29 of file statslogic.hpp.

Member Enumeration Documentation

◆ OperationType

Enumerator
OPERATION_ADD 
OPERATION_MULT 
OPERATION_ADDSQ 
OPERATION_ADDSQSUB 
OPERATION_MAX 
OPERATION_MIN 
OPERATION_NUM 

Definition at line 31 of file statslogic.hpp.

Constructor & Destructor Documentation

◆ StatsLogic()

StatsLogic::StatsLogic ( OperationType  type,
double  baseVal = 0.0,
mu::value_type  compVal = 0.0 
)
inline

Definition at line 46 of file statslogic.hpp.

Member Function Documentation

◆ combine()

void StatsLogic::combine ( const StatsLogic other)
inline

Combines results from different StatsLogic instances into a single result.

Parameters
otherconst StatsLogic&
Returns
void

Definition at line 95 of file statslogic.hpp.

References mu::isnan(), m_type, m_val, OPERATION_ADD, OPERATION_ADDSQ, OPERATION_ADDSQSUB, OPERATION_MAX, OPERATION_MIN, OPERATION_MULT, and OPERATION_NUM.

Here is the call graph for this function:

◆ operator()()

void StatsLogic::operator() ( const mu::value_type newVal)
inline

Implements the statistics logic.

Parameters
newValconst mu::value_type&
Returns
void

Definition at line 56 of file statslogic.hpp.

References mu::isnan(), m_compval, m_type, m_val, OPERATION_ADD, OPERATION_ADDSQ, OPERATION_ADDSQSUB, OPERATION_MAX, OPERATION_MIN, OPERATION_MULT, and OPERATION_NUM.

Here is the call graph for this function:

Member Data Documentation

◆ m_compval

mu::value_type StatsLogic::m_compval

Definition at line 43 of file statslogic.hpp.

Referenced by operator()().

◆ m_type

OperationType StatsLogic::m_type

Definition at line 44 of file statslogic.hpp.

Referenced by combine(), and operator()().

◆ m_val

mu::value_type StatsLogic::m_val

Definition at line 42 of file statslogic.hpp.

Referenced by combine(), and operator()().


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