Struct astrea::trace::Stats¶
template <class T>
ClassList > astrea > trace > Stats
The Stats struct represents basic statistics (min, max, average, and percentiles) for a vector of values of type T.
#include <Stats.hpp>
Public Attributes¶
| Type | Name |
|---|---|
| T | avg The average value in the vector. |
| T | max The maximum value in the vector. |
| T | min The minimum value in the vector. |
| std::vector< T > | percentiles A vector of percentiles corresponding to the DEFAULT_PERCENTILES. |
Public Functions¶
| Type | Name |
|---|---|
| Stats () = default Default constructor for Stats . |
|
| Stats (const RiseSetArray & risesets, const RiseSetMetric & metric) = delete Constructs a Stats object from a vector of values of type T. Deleted for non-Time types. |
|
| Stats (std::vector< T > values) Constructs a Stats object from a vector of values of type T. |
|
| Stats (const RiseSetArray & risesets, const RiseSetMetric & metric) Specialization of the Stats struct for Time type, which can be constructed from aRiseSetArray and a RiseSetMetric. |
|
| std::vector< std::string > | to_string_vector () const Converts the statistics to a vector of strings for output. |
| std::vector< std::string > | to_string_vector () const Specialization of the to_string_vector method for Time type, which formats the Time values as strings. |
Public Static Functions¶
| Type | Name |
|---|---|
| constexpr std::size_t | size () |
Public Attributes Documentation¶
variable avg¶
The average value in the vector.
variable max¶
The maximum value in the vector.
variable min¶
The minimum value in the vector.
variable percentiles¶
A vector of percentiles corresponding to the DEFAULT_PERCENTILES.
Public Functions Documentation¶
function Stats [1/4]¶
Default constructor for Stats .
function Stats [2/4]¶
Constructs a Stats object from a vector of values of type T. Deleted for non-Time types.
astrea::trace::Stats::Stats (
const RiseSetArray & risesets,
const RiseSetMetric & metric
) = delete
Parameters:
valuesA vector of values to calculate statistics for.
Exception:
std::runtime_errorIf the input vector is empty.
function Stats [3/4]¶
Constructs a Stats object from a vector of values of type T.
Parameters:
valuesA vector of values to calculate statistics for.
Exception:
std::runtime_errorIf the input vector is empty.
function Stats [4/4]¶
Specialization of the Stats struct for Time type, which can be constructed from aRiseSetArray and a RiseSetMetric.
Template parameters:
TThe type of the statistics, specialized for Time.
Parameters:
risesetsThe RiseSetArray containing the rise and set times to calculate statistics for.metricThe RiseSetMetric indicating which metric to calculate statistics for (ACCESS_TIME or GAP).
Exception:
std::runtime_errorIf the RiseSetMetric is unrecognized.
function to_string_vector [1/2]¶
Converts the statistics to a vector of strings for output.
Returns:
std::vector<std::string> A vector of strings representing the statistics.
function to_string_vector [2/2]¶
Specialization of the to_string_vector method for Time type, which formats the Time values as strings.
Returns:
std::vector<std::string> A vector of strings representing the statistics, formatted as time strings.
Public Static Functions Documentation¶
function size¶
The documentation for this class was generated from the following file astrea/trace/trace/analysis/stats/Stats.hpp