Loading...
Searching...
No Matches
Opm::RunningStatistics< Scalar > Class Template Reference

Facility for calculating simple sample statistics without having full sample available. More...

`#include <RunningStatistics.hpp>`

## Public Member Functions

template<class Serializer>
void | serializeOp (Serializer &serializer)
| Convert between byte array and object representation.
bool | operator== (const RunningStatistics &that) const
| Equality predicate.
void | reset ()
| Reset internal counters to prepare for calculating a new set of sample statistics.
void | addSamplePoint (const Scalar x)
| Include new element into sample.
std::size_t | sampleSize () const
| Retrieve current sample size.
Scalar | min () const
| Retrieve smallest sample value seen so far.
Scalar | max () const
| Retrieve largest sample value seen so far.
Scalar | mean () const
| Retrieve arithmetic average of all sample points seen so far.
std::optional< Scalar > | stdev () const
| Retrieve unbiased standard deviation of all sample points seen so far.

## Static Public Member Functions

static RunningStatistics | serializationTestObject ()
| Create a serialisation test object.

## Detailed Description

template<typename Scalar>
class Opm::RunningStatistics< Scalar >

Facility for calculating simple sample statistics without having full sample available.

Template Parameters

  Scalar | Sample element type. Typically a built-in arithmetic type like `float` or `double`.

## Member Function Documentation

## addSamplePoint()

template<typename Scalar>

void Opm::RunningStatistics< Scalar >::addSamplePoint | ( | const Scalar | x | ) |

inline

Include new element into sample.

Updates internal statistics counters.

Parameters

  [in] | x | Sample point.

## operator==()

template<typename Scalar>

bool Opm::RunningStatistics< Scalar >::operator== | ( | const RunningStatistics< Scalar > & | that | ) | const

inline

Equality predicate.

Parameters

  [in] | that | Object against which *this will be tested for equality.

Returns
  Whether or not
  *this
  is the same as `that`.

## sampleSize()

template<typename Scalar>

std::size_t Opm::RunningStatistics< Scalar >::sampleSize | ( |  | ) | const

inline

Retrieve current sample size.

Effectively returns the number of calls to addSamplePoint() since object was constructed or since the previous call to reset().

## serializeOp()

template<typename Scalar>
template<class Serializer>

void Opm::RunningStatistics< Scalar >::serializeOp | ( | Serializer & | serializer | ) |

inline

Convert between byte array and object representation.

Template Parameters

  Serializer | Byte array conversion protocol.

Parameters

  [in,out] | serializer | Byte array conversion object.

## stdev()

template<typename Scalar>

std::optional< Scalar > Opm::RunningStatistics< Scalar >::stdev | ( |  | ) | const

inline

Retrieve unbiased standard deviation of all sample points seen so far.

Returns nullopt if number of sample points is less than two.

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

- opm/simulators/wells/RunningStatistics.hpp