28 #include <rdbxx/RDB.h> 33 enum struct Normalize { Average, Median, None };
34 enum struct OverrideType { Toggle, String, Number };
40 DefOverride(
const std::string& colname_, OverrideType type_ ) : colname(colname_), type(type_) {}
44 using DefOverrideList = std::vector<DefOverride>;
50 Percentile(
const std::string& colname_,
double percentile_ ) : colname(colname_), percentile(percentile_) {}
53 using PercentileList = std::vector<Percentile>;
67 RdbStats( RDB& irdbtable,
const std::string& name );
77 virtual void normalize_results(
const double norm );
79 virtual void set_output_columns( RDB& ordbtable );
87 RDBColumn* input_column;
90 std::vector<RDBColumn*> output_stats;
94 enum Stats { AVG, MAX, MIN, SD, SUM, SUM2, SUM_T };
100 double the_statistics[ 7 ];
107 std::string to_string( std::string );
108 std::string to_string( Normalize );
109 std::string to_string( OverrideType );
110 std::string to_string( Percentile );
111 std::string to_string( DefOverride );
115 std::string to_string( std::vector<T> values ) {
118 std::stringstream os;
120 bool first_elem =
true;
121 for (
const auto& value : values ) {
126 os << to_string(value);
The base class to calculate : average, maximum, minimum, num, stddev and sum.
double get_absolute_average() const
To get the absolute value of the average.
virtual void update_statistics()
Read the column from RDB++, update the statistics for the column.
virtual int calculate_statistics()
Perform the final statistic for the set.