DiSMEC++
dismec::stats::BasicStat Class Referencefinal

#include <statistics.h>

Inheritance diagram for dismec::stats::BasicStat:
dismec::stats::StatImplBase< BasicStat > dismec::stats::Statistics

Public Member Functions

 ~BasicStat () override=default
 
void record_int (long value) override
 
void record_real (real_t value) override
 
std::unique_ptr< Statisticsclone () const override
 
void merge_imp (const BasicStat &other)
 
nlohmann::json to_json () const override
 Converts the statistics current value into a json object. More...
 
- Public Member Functions inherited from dismec::stats::StatImplBase< BasicStat >
void merge (const Statistics &other) override
 Merges this statistics of another one of the same type and settings. More...
 
void record_vec (const DenseRealVector &vector) override
 
- Public Member Functions inherited from dismec::stats::Statistics
virtual ~Statistics ()=default
 
void record (int integer)
 
void record (long integer)
 
void record (real_t real)
 
void record (const DenseRealVector &vector)
 
virtual void setup (const StatisticsCollection &source)
 This function has to be called before the Statistics is used to collect data for the first time. More...
 

Private Attributes

long m_Counter = 0
 
double m_Sum = 0
 
double m_SumSquared = 0
 

Detailed Description

Definition at line 27 of file statistics.h.

Constructor & Destructor Documentation

◆ ~BasicStat()

dismec::stats::BasicStat::~BasicStat ( )
overridedefault

Member Function Documentation

◆ clone()

std::unique_ptr< Statistics > BasicStat::clone ( ) const
overridevirtual

Implements dismec::stats::Statistics.

Definition at line 39 of file statistics.cpp.

◆ merge_imp()

void BasicStat::merge_imp ( const BasicStat other)

Definition at line 43 of file statistics.cpp.

References m_Counter, m_Sum, and m_SumSquared.

◆ record_int()

void BasicStat::record_int ( long  value)
overridevirtual

Reimplemented from dismec::stats::Statistics.

Definition at line 29 of file statistics.cpp.

References dismec::stats::Statistics::record().

◆ record_real()

void BasicStat::record_real ( real_t  value)
overridevirtual

Reimplemented from dismec::stats::Statistics.

Definition at line 33 of file statistics.cpp.

References m_Counter, m_Sum, and m_SumSquared.

◆ to_json()

nlohmann::json BasicStat::to_json ( ) const
overridevirtual

Converts the statistics current value into a json object.

Implements dismec::stats::Statistics.

Definition at line 49 of file statistics.cpp.

References m_Counter, m_Sum, and m_SumSquared.

Member Data Documentation

◆ m_Counter

long dismec::stats::BasicStat::m_Counter = 0
private

Definition at line 37 of file statistics.h.

Referenced by merge_imp(), record_real(), and to_json().

◆ m_Sum

double dismec::stats::BasicStat::m_Sum = 0
private

Definition at line 38 of file statistics.h.

Referenced by merge_imp(), record_real(), and to_json().

◆ m_SumSquared

double dismec::stats::BasicStat::m_SumSquared = 0
private

Definition at line 39 of file statistics.h.

Referenced by merge_imp(), record_real(), and to_json().


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