DiSMEC++
|
TODO maybe we should solve this with a variant which does the dispatch of expected type and tag. More...
#include <stats_base.h>
Public Member Functions | |
virtual | ~Statistics ()=default |
void | record (int integer) |
void | record (long integer) |
void | record (real_t real) |
void | record (const DenseRealVector &vector) |
virtual std::unique_ptr< Statistics > | clone () const =0 |
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... | |
virtual void | merge (const Statistics &other)=0 |
Merges this statistics of another one of the same type and settings. More... | |
virtual nlohmann::json | to_json () const =0 |
Converts the statistics current value into a json object. More... | |
Private Member Functions | |
virtual void | record_int (long integer) |
virtual void | record_real (real_t real) |
virtual void | record_vec (const DenseRealVector &vector) |
TODO maybe we should solve this with a variant which does the dispatch of expected type and tag.
Definition at line 65 of file stats_base.h.
|
virtualdefault |
|
pure virtual |
|
pure virtual |
Merges this statistics of another one of the same type and settings.
This operation is used to perform the reduction of the thread-local statistics into a single global statistics. For this to be possible, the merged statistics need to have not only the same type, but also the same settings (e.g. number of bins in a histogram). This is true for the thread local copies, which are clones of one another.
other | The statistics object to be merged into this. Must be of same type and have the same settings, e.g. a clone of this. |
Implemented in dismec::stats::StatImplBase< Derived >, dismec::stats::StatImplBase< VectorReductionStat >, dismec::stats::StatImplBase< TaggedStat >, dismec::stats::StatImplBase< MultiStat >, dismec::stats::StatImplBase< BasicStat >, dismec::stats::StatImplBase< FullRecordStat >, dismec::stats::StatImplBase< CounterStat >, and anonymous_namespace{collection.cpp}::MockStat.
|
inline |
Definition at line 74 of file stats_base.h.
References record_vec().
|
inline |
Definition at line 70 of file stats_base.h.
References record().
Referenced by record(), dismec::stats::BasicStat::record_int(), dismec::stats::TaggedStat::record_int(), and dismec::stats::StatImplBase< Derived >::record_vec().
|
inline |
Definition at line 72 of file stats_base.h.
References record_int().
|
inline |
Definition at line 73 of file stats_base.h.
References record_real().
|
inlineprivatevirtual |
Reimplemented in dismec::stats::FullRecordStat, dismec::stats::MultiStat, dismec::stats::TaggedStat, dismec::stats::BasicStat, dismec::stats::CounterStat, and anonymous_namespace{collection.cpp}::MockStat.
Definition at line 102 of file stats_base.h.
Referenced by record().
|
inlineprivatevirtual |
Reimplemented in dismec::stats::FullRecordStat, dismec::stats::MultiStat, dismec::stats::TaggedStat, and dismec::stats::BasicStat.
Definition at line 103 of file stats_base.h.
Referenced by record().
|
inlineprivatevirtual |
Reimplemented in dismec::stats::StatImplBase< Derived >, dismec::stats::StatImplBase< VectorReductionStat >, dismec::stats::StatImplBase< TaggedStat >, dismec::stats::StatImplBase< MultiStat >, dismec::stats::StatImplBase< BasicStat >, dismec::stats::StatImplBase< FullRecordStat >, dismec::stats::StatImplBase< CounterStat >, dismec::stats::MultiStat, and dismec::stats::VectorReductionStat.
Definition at line 104 of file stats_base.h.
Referenced by record().
|
inlinevirtual |
This function has to be called before the Statistics
is used to collect data for the first time.
This will look up any tags that might be used within the statistics in source
.
std::runtime_error | if a tag is required by the statistics but cannot be found in source . |
source | The statistics collection from which the tags can be read. |
Reimplemented in dismec::stats::MultiStat, and dismec::stats::TaggedStat.
Definition at line 84 of file stats_base.h.
|
pure virtual |
Converts the statistics current value into a json object.
Implemented in dismec::stats::VectorReductionStat, dismec::stats::FullRecordStat, dismec::stats::MultiStat, dismec::stats::TaggedStat, dismec::stats::BasicStat, dismec::stats::CounterStat, and anonymous_namespace{collection.cpp}::MockStat.