|
Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
|
Generic one-dimensional container of values with optional string index. More...
#include <Series.h>
Public Member Functions | |
| Series () | |
| Default constructor. | |
| Series (const std::string &colName) | |
| Constructs a Series with a given column name. | |
| void | add (const T &value) |
| Appends a value at the end of the series (without index). | |
| void | add (const T &value, const std::string &idx) |
| Appends a value with an associated index label. | |
| T | iat (size_t idx) const |
| Positional access to the i-th element. | |
| T | at (const std::string &idx) const |
| Label-based access to a value. | |
| size_t | size () const |
| Returns the number of elements stored in the series. | |
| const std::string & | getName () const |
| Returns the series name. | |
| void | print () const |
| Prints all stored values to std::cout. | |
| T | min () const |
| Returns the minimum value in the series. | |
| T | max () const |
| Returns the maximum value in the series. | |
| double | mean () const |
| Computes the arithmetic mean of the series. | |
| double | stddev () const |
| Computes the (population) standard deviation of the series. | |
| std::vector< T > | quartiles () const |
| Returns the first, second (median), and third quartiles. | |
| const std::shared_ptr< std::vector< std::string > > & | getIndex () const |
| Accessor to the shared index vector. | |
| std::vector< T > | to_vec () |
| Returns a copy of the underlying data as a std::vector. | |
| std::vector< std::string > | to_string_vec () |
| Returns a vector of stringified values. | |
Generic one-dimensional container of values with optional string index.
The Series<T> class is intended as a lightweight helper for handling small numerical (or generic) datasets. It supports:
The index is shared via a std::shared_ptr so that multiple Series can share the same labels if needed.
| T | Value type (typically arithmetic, but not strictly required for all operations except statistics). |
Constructs a Series with a given column name.
| colName | Human-readable name of the series (e.g. "mass", "q2"). |
Appends a value at the end of the series (without index).
The associated index entry, if any, is not modified. This is mainly useful for purely positional series.
| value | Value to append. |
Label-based access to a value.
Searches the index for the given label and returns the corresponding data value.
| idx | Index label (string). |
| std::invalid_argument | if the index label is not found. |
Returns the series name.
Positional access to the i-th element.
| idx | Zero-based position in the series. |
| std::out_of_range | if idx >= size(). |
Returns the maximum value in the series.
| std::runtime_error | if the series is empty. |
Computes the arithmetic mean of the series.
| std::runtime_error | if the series is empty. |
Returns the minimum value in the series.
| std::runtime_error | if the series is empty. |
Prints all stored values to std::cout.
This is mainly intended for debugging or quick inspection.
Returns the first, second (median), and third quartiles.
The method sorts a copy of the data and picks elements at 25%, 50% and 75% of the size.
| std::runtime_error | if the series is empty. |
Returns the number of elements stored in the series.
Computes the (population) standard deviation of the series.
The variance is computed as: var = (1/N) * sum_i (x_i - mean)^2
| std::runtime_error | if the series is empty. |