Skip to content

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.

T astrea::trace::Stats< T >::avg;


variable max

The maximum value in the vector.

T astrea::trace::Stats< T >::max;


variable min

The minimum value in the vector.

T astrea::trace::Stats< T >::min;


variable percentiles

A vector of percentiles corresponding to the DEFAULT_PERCENTILES.

std::vector<T> astrea::trace::Stats< T >::percentiles;


Public Functions Documentation

function Stats [1/4]

Default constructor for Stats .

astrea::trace::Stats::Stats () = default


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:

  • values A vector of values to calculate statistics for.

Exception:

  • std::runtime_error If the input vector is empty.

function Stats [3/4]

Constructs a Stats object from a vector of values of type T.

inline astrea::trace::Stats::Stats (
    std::vector< T > values
) 

Parameters:

  • values A vector of values to calculate statistics for.

Exception:

  • std::runtime_error If 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.

inline astrea::trace::Stats::Stats (
    const RiseSetArray & risesets,
    const RiseSetMetric & metric
) 

Template parameters:

  • T The type of the statistics, specialized for Time.

Parameters:

  • risesets The RiseSetArray containing the rise and set times to calculate statistics for.
  • metric The RiseSetMetric indicating which metric to calculate statistics for (ACCESS_TIME or GAP).

Exception:

  • std::runtime_error If the RiseSetMetric is unrecognized.

function to_string_vector [1/2]

Converts the statistics to a vector of strings for output.

inline std::vector< std::string > astrea::trace::Stats::to_string_vector () const

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.

inline std::vector< std::string > astrea::trace::Stats::to_string_vector () const

Returns:

std::vector<std::string> A vector of strings representing the statistics, formatted as time strings.


Public Static Functions Documentation

function size

static inline constexpr std::size_t astrea::trace::Stats::size () 


The documentation for this class was generated from the following file astrea/trace/trace/analysis/stats/Stats.hpp