ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
Utils::Statistics::RunningAverage< Scalar > Class Template Reference

Keep running average and variance. More...

#include <RunningAverage.hpp>

Public Member Functions

 RunningAverage ()
 
void add_sample (Scalar s)
 
void clear ()
 
int n () const
 
Scalar avg () const
 Average of the samples.
 
Scalar var () const
 Variance of the samples.
 
Scalar sig () const
 Standard deviation of the samples.
 
Scalar min () const
 Minimum.
 
Scalar max () const
 Minimum.
 

Detailed Description

template<typename Scalar>
class Utils::Statistics::RunningAverage< Scalar >

Keep running average and variance.

The average should be numerically stable.

Definition at line 36 of file RunningAverage.hpp.

Constructor & Destructor Documentation

◆ RunningAverage()

template<typename Scalar >
Utils::Statistics::RunningAverage< Scalar >::RunningAverage ( )
inline

Definition at line 38 of file RunningAverage.hpp.

Member Function Documentation

◆ add_sample()

template<typename Scalar >
void Utils::Statistics::RunningAverage< Scalar >::add_sample ( Scalar  s)
inline

Definition at line 42 of file RunningAverage.hpp.

Referenced by benchmark_integration_step().

◆ avg()

template<typename Scalar >
Scalar Utils::Statistics::RunningAverage< Scalar >::avg ( ) const
inline

Average of the samples.

Definition at line 64 of file RunningAverage.hpp.

Referenced by benchmark_integration_step(), and check_statistics().

◆ clear()

template<typename Scalar >
void Utils::Statistics::RunningAverage< Scalar >::clear ( )
inline

Definition at line 59 of file RunningAverage.hpp.

◆ max()

template<typename Scalar >
Scalar Utils::Statistics::RunningAverage< Scalar >::max ( ) const
inline

Minimum.

Definition at line 85 of file RunningAverage.hpp.

◆ min()

template<typename Scalar >
Scalar Utils::Statistics::RunningAverage< Scalar >::min ( ) const
inline

Minimum.

Definition at line 82 of file RunningAverage.hpp.

◆ n()

template<typename Scalar >
int Utils::Statistics::RunningAverage< Scalar >::n ( ) const
inline

Definition at line 61 of file RunningAverage.hpp.

◆ sig()

template<typename Scalar >
Scalar Utils::Statistics::RunningAverage< Scalar >::sig ( ) const
inline

Standard deviation of the samples.

Definition at line 79 of file RunningAverage.hpp.

References Utils::Statistics::RunningAverage< Scalar >::var().

Referenced by check_statistics().

◆ var()

template<typename Scalar >
Scalar Utils::Statistics::RunningAverage< Scalar >::var ( ) const
inline

Variance of the samples.

Definition at line 71 of file RunningAverage.hpp.

Referenced by Utils::Statistics::RunningAverage< Scalar >::sig().


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