6 #ifndef DISMEC_STATS_STATISTICS_H
7 #define DISMEC_STATS_STATISTICS_H
10 #include <unordered_map>
20 [[nodiscard]] std::unique_ptr<Statistics>
clone()
const override;
33 [[nodiscard]] std::unique_ptr<Statistics>
clone()
const override;
44 TaggedStat(std::string tag,
int max_tag, std::string transform_name = {}, std::function<double(
double)> transform = {});
49 [[nodiscard]] std::unique_ptr<Statistics>
clone()
const override;
68 MultiStat(std::unordered_map<std::string, std::unique_ptr<Statistics>> ss);
74 [[nodiscard]] std::unique_ptr<Statistics>
clone()
const override;
80 using stats_map_t = std::unordered_map<std::string, std::unique_ptr<Statistics>>;
94 [[nodiscard]] std::unique_ptr<Statistics>
clone()
const override;
110 [[nodiscard]] std::unique_ptr<Statistics>
clone()
const override;
void record_real(real_t value) override
void record_int(long value) override
~BasicStat() override=default
nlohmann::json to_json() const override
Converts the statistics current value into a json object.
std::unique_ptr< Statistics > clone() const override
void merge_imp(const BasicStat &other)
nlohmann::json to_json() const override
Converts the statistics current value into a json object.
std::unique_ptr< Statistics > clone() const override
void merge_imp(const CounterStat &other)
~CounterStat() override=default
void record_int(long integer) override
void record_int(long value) override
void merge_imp(const FullRecordStat &other)
void record_real(real_t value) override
nlohmann::json to_json() const override
Converts the statistics current value into a json object.
~FullRecordStat() override=default
std::unique_ptr< Statistics > clone() const override
std::vector< real_t > m_Data
std::unordered_map< std::string, std::unique_ptr< Statistics > > stats_map_t
std::unique_ptr< Statistics > clone() const override
void record_real(real_t value) override
void merge_imp(const MultiStat &other)
void record_int(long value) override
void record_vec(const DenseRealVector &vector) override
void setup(const StatisticsCollection &source) override
This function has to be called before the Statistics is used to collect data for the first time.
MultiStat(std::unordered_map< std::string, std::unique_ptr< Statistics >> ss)
~MultiStat() override=default
nlohmann::json to_json() const override
Converts the statistics current value into a json object.
Helper class for implementing Statistics classes.
This class manages a collection of named Statistics objects.
A tag container combines a name with a shared pointer, which points to the tag value.
void record_int(long value) override
void record_real(real_t value) override
std::vector< double > m_Sums
std::vector< long > m_Counters
TaggedStat(std::string tag, int max_tag, std::string transform_name={}, std::function< double(double)> transform={})
void merge_imp(const TaggedStat &other)
std::vector< double > m_SumsSquared
void setup(const StatisticsCollection &source) override
This function has to be called before the Statistics is used to collect data for the first time.
std::string m_TransformName
~TaggedStat() override=default
std::function< double(double)> m_Transform
nlohmann::json to_json() const override
Converts the statistics current value into a json object.
std::unique_ptr< Statistics > clone() const override
std::function< real_t(const DenseRealVector &)> m_Reduction
std::unique_ptr< Statistics > clone() const override
std::string m_ReductionName
VectorReductionStat(std::unique_ptr< Statistics > stat, std::string reduction)
~VectorReductionStat() override=default
void record_vec(const DenseRealVector &value) override
nlohmann::json to_json() const override
Converts the statistics current value into a json object.
std::unique_ptr< Statistics > m_Target
void merge_imp(const VectorReductionStat &other)
types::DenseVector< real_t > DenseRealVector
Any dense, real values vector.
float real_t
The default type for floating point values.