OpenMD  2.5
Molecular Dynamics in the Open
OpenMD::Accumulator Class Reference

#include <Accumulator.hpp>

Inheritance diagram for OpenMD::Accumulator:
OpenMD::BaseAccumulator

Public Member Functions

 Accumulator ()
 
 ~Accumulator ()
 
virtual void add (ElementType const &val)
 
void clear ()
 
void getLastValue (ElementType &ret)
 
void getAverage (ResultType &ret)
 
void getVariance (ResultType &ret)
 
void getStdDev (ResultType &ret)
 
void getMax (ElementType &ret)
 
void getMin (ElementType &ret)
 
void get95percentConfidenceInterval (ResultType &ret)
 
- Public Member Functions inherited from OpenMD::BaseAccumulator
virtual size_t count ()
 
virtual ~BaseAccumulator ()
 

Private Types

typedef RealType ElementType
 
typedef RealType ResultType
 

Private Attributes

ElementType Val_
 
ResultType Avg_
 
ResultType Avg2_
 
ElementType Min_
 
ElementType Max_
 

Additional Inherited Members

- Protected Attributes inherited from OpenMD::BaseAccumulator
size_t Count_
 

Detailed Description

Basic Accumulator class for numbers.

Definition at line 74 of file Accumulator.hpp.

Member Typedef Documentation

◆ ElementType

typedef RealType OpenMD::Accumulator::ElementType
private

Definition at line 76 of file Accumulator.hpp.

◆ ResultType

typedef RealType OpenMD::Accumulator::ResultType
private

Definition at line 77 of file Accumulator.hpp.

Constructor & Destructor Documentation

◆ Accumulator()

OpenMD::Accumulator::Accumulator ( )
inline

Definition at line 81 of file Accumulator.hpp.

References OpenMD::BaseAccumulator::clear().

◆ ~Accumulator()

OpenMD::Accumulator::~Accumulator ( )
inline

Definition at line 85 of file Accumulator.hpp.

Member Function Documentation

◆ add()

virtual void OpenMD::Accumulator::add ( ElementType const &  val)
inlinevirtual

Accumulate another value

Definition at line 90 of file Accumulator.hpp.

References OpenMD::BaseAccumulator::Count_.

Referenced by OpenMD::RNEMD::collectData(), and OpenMD::PotDiff::process().

◆ clear()

void OpenMD::Accumulator::clear ( void  )
inlinevirtual

reset the Accumulator to the empty state

Implements OpenMD::BaseAccumulator.

Definition at line 107 of file Accumulator.hpp.

References OpenMD::BaseAccumulator::Count_.

◆ get95percentConfidenceInterval()

void OpenMD::Accumulator::get95percentConfidenceInterval ( ResultType ret)
inline

return the 95% confidence interval:

That is returns c, such that we have 95% confidence that the true mean is within 2c of the Average (x):

x - c <= true mean <= x + c

Definition at line 180 of file Accumulator.hpp.

References OpenMD::BaseAccumulator::Count_.

Referenced by OpenMD::PotDiff::writeDiff().

◆ getAverage()

void OpenMD::Accumulator::getAverage ( ResultType ret)
inline

compute the Mean

Definition at line 126 of file Accumulator.hpp.

References OpenMD::BaseAccumulator::Count_.

Referenced by OpenMD::PotDiff::writeDiff(), and OpenMD::RNEMD::writeOutputFile().

◆ getLastValue()

void OpenMD::Accumulator::getLastValue ( ElementType ret)
inline

return the most recently added value

Definition at line 118 of file Accumulator.hpp.

◆ getMax()

void OpenMD::Accumulator::getMax ( ElementType ret)
inline

return the largest value

Definition at line 156 of file Accumulator.hpp.

References OpenMD::BaseAccumulator::Count_.

◆ getMin()

void OpenMD::Accumulator::getMin ( ElementType ret)
inline

return the smallest value

Definition at line 165 of file Accumulator.hpp.

References OpenMD::BaseAccumulator::Count_.

◆ getStdDev()

void OpenMD::Accumulator::getStdDev ( ResultType ret)
inline

compute error of average value

Definition at line 145 of file Accumulator.hpp.

References OpenMD::BaseAccumulator::Count_.

Referenced by OpenMD::PotDiff::writeDiff().

◆ getVariance()

void OpenMD::Accumulator::getVariance ( ResultType ret)
inline

compute the Variance

Definition at line 135 of file Accumulator.hpp.

References OpenMD::BaseAccumulator::Count_.

Member Data Documentation

◆ Avg2_

ResultType OpenMD::Accumulator::Avg2_
private

Definition at line 191 of file Accumulator.hpp.

◆ Avg_

ResultType OpenMD::Accumulator::Avg_
private

Definition at line 190 of file Accumulator.hpp.

◆ Max_

ElementType OpenMD::Accumulator::Max_
private

Definition at line 193 of file Accumulator.hpp.

◆ Min_

ElementType OpenMD::Accumulator::Min_
private

Definition at line 192 of file Accumulator.hpp.

◆ Val_

ElementType OpenMD::Accumulator::Val_
private

Definition at line 189 of file Accumulator.hpp.


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