DiSMEC++
|
#include <statistics.h>
Public Member Functions | |
TaggedStat (std::string tag, int max_tag, std::string transform_name={}, std::function< double(double)> transform={}) | |
~TaggedStat () override=default | |
void | record_int (long value) override |
void | record_real (real_t value) override |
std::unique_ptr< Statistics > | clone () const override |
void | merge_imp (const TaggedStat &other) |
nlohmann::json | to_json () const override |
Converts the statistics current value into a json object. More... | |
void | setup (const StatisticsCollection &source) override |
This function has to be called before the Statistics is used to collect data for the first time. More... | |
Public Member Functions inherited from dismec::stats::StatImplBase< TaggedStat > | |
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) |
Private Attributes | |
std::vector< long > | m_Counters |
std::vector< double > | m_Sums |
std::vector< double > | m_SumsSquared |
TagContainer | m_Tag |
int | m_MaxTag = -1 |
std::function< double(double)> | m_Transform |
std::string | m_TransformName |
Definition at line 42 of file statistics.h.
TaggedStat::TaggedStat | ( | std::string | tag, |
int | max_tag, | ||
std::string | transform_name = {} , |
||
std::function< double(double)> | transform = {} |
||
) |
Definition at line 54 of file statistics.cpp.
|
overridedefault |
|
overridevirtual |
Implements dismec::stats::Statistics.
Definition at line 86 of file statistics.cpp.
References dismec::stats::TagContainer::get_name(), m_MaxTag, m_Tag, m_Transform, and m_TransformName.
void TaggedStat::merge_imp | ( | const TaggedStat & | other | ) |
Definition at line 90 of file statistics.cpp.
References m_Counters, m_Sums, m_SumsSquared, and dismec::ssize().
|
overridevirtual |
Reimplemented from dismec::stats::Statistics.
Definition at line 62 of file statistics.cpp.
References dismec::stats::Statistics::record().
|
overridevirtual |
Reimplemented from dismec::stats::Statistics.
Definition at line 66 of file statistics.cpp.
References dismec::stats::TagContainer::get_value(), m_Counters, m_MaxTag, m_Sums, m_SumsSquared, m_Tag, m_Transform, and dismec::ssize().
|
overridevirtual |
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 from dismec::stats::Statistics.
Definition at line 110 of file statistics.cpp.
References dismec::stats::TagContainer::get_name(), dismec::stats::StatisticsCollection::get_tag_by_name(), and m_Tag.
|
overridevirtual |
Converts the statistics current value into a json object.
Implements dismec::stats::Statistics.
Definition at line 105 of file statistics.cpp.
References m_Counters, m_Sums, m_SumsSquared, and m_TransformName.
|
private |
Definition at line 55 of file statistics.h.
Referenced by merge_imp(), record_real(), and to_json().
|
private |
Definition at line 60 of file statistics.h.
Referenced by clone(), and record_real().
|
private |
Definition at line 56 of file statistics.h.
Referenced by merge_imp(), record_real(), and to_json().
|
private |
Definition at line 57 of file statistics.h.
Referenced by merge_imp(), record_real(), and to_json().
|
private |
Definition at line 59 of file statistics.h.
Referenced by clone(), record_real(), and setup().
|
private |
Definition at line 62 of file statistics.h.
Referenced by clone(), and record_real().
|
private |
Definition at line 63 of file statistics.h.