Health-GPS
1.2.2.0
Global Health Policy Simulation model (Health-GPS)
|
Defines the Simulation results container for time series data. More...
#include <data_series.h>
Public Member Functions | |
DataSeries ()=delete | |
DataSeries (std::size_t sample_size) | |
Initialises a new instance of the DataSeries class. More... | |
std::vector< double > & | operator() (core::Gender gender, std::string key) |
Gets a reference to a channel by Gender and identifier. More... | |
std::vector< double > & | at (core::Gender gender, std::string key) |
Gets a reference to a channel by Gender and identifier. More... | |
const std::vector< double > & | at (core::Gender gender, std::string key) const |
Gets a read-only reference to a channel by Gender and identifier. More... | |
const std::vector< std::string > & | channels () const noexcept |
Gets the collection of channel identifiers. More... | |
void | add_channel (std::string key) |
Adds a new channel to the collection. More... | |
void | add_channels (const std::vector< std::string > &keys) |
Adds multiple channels to the collection. More... | |
std::size_t | size () const noexcept |
Gets the size of the channels collection. More... | |
std::size_t | sample_size () const noexcept |
Gets the channels sample size, number of points per channel. More... | |
Defines the Simulation results container for time series data.
Channels with the time series result data are stored by Gender and Identifier. The collection of channels is dynamic, but all channels must contain exact the same number of data points, sample size, as given during initialisation.
|
delete |
hgps::DataSeries::DataSeries | ( | std::size_t | sample_size | ) |
Initialises a new instance of the DataSeries class.
sample_size | The channels sample size, number of data points. |
void hgps::DataSeries::add_channel | ( | std::string | key | ) |
Adds a new channel to the collection.
key | The new channel unique identifier |
std::logic_error | for duplicated channel identifier |
void hgps::DataSeries::add_channels | ( | const std::vector< std::string > & | keys | ) |
Adds multiple channels to the collection.
keys | The new channels identifier |
std::logic_error | for duplicated channel identifier |
std::vector< double > & hgps::DataSeries::at | ( | core::Gender | gender, |
std::string | key | ||
) |
Gets a reference to a channel by Gender and identifier.
gender | The gender enumeration |
key | The channel identifier |
std::out_of_range | if the container does not have a channel with the specified age and key |
const std::vector< double > & hgps::DataSeries::at | ( | core::Gender | gender, |
std::string | key | ||
) | const |
Gets a read-only reference to a channel by Gender and identifier.
gender | The gender enumeration |
key | The channel identifier |
std::out_of_range | if the container does not have a channel with the specified age and key |
|
noexcept |
Gets the collection of channel identifiers.
std::vector< double > & hgps::DataSeries::operator() | ( | core::Gender | gender, |
std::string | key | ||
) |
Gets a reference to a channel by Gender and identifier.
gender | The gender enumeration |
key | The channel identifier |
std::out_of_range | if the container does not have a channel with the specified age and key |
|
noexcept |
Gets the channels sample size, number of points per channel.
|
noexcept |
Gets the size of the channels collection.