23using LmsDataset = std::map<unsigned int, std::map<core::Gender, LmsRecord>>;
37 throw std::invalid_argument(
"The LMS definition must not be empty.");
43 bool empty() const noexcept {
return table_.empty(); }
47 std::size_t
size() const noexcept {
return table_.size(); }
51 unsigned int min_age() const noexcept {
return table_.cbegin()->first; }
55 unsigned int max_age() const noexcept {
return table_.rbegin()->first; }
62 if (table_.contains(age)) {
63 return table_.at(age).contains(gender);
75 return table_.at(age).at(gender);
LMS (lambda-mu-sigma) model definition data type.
Definition lms_definition.h:26
unsigned int max_age() const noexcept
Gets the definition maximum age.
Definition lms_definition.h:55
LmsDefinition()=default
Initialises a new instance of the LmsDefinition class.
LmsDefinition(LmsDataset &&dataset)
Initialises a new instance of the LmsDefinition class.
Definition lms_definition.h:34
bool empty() const noexcept
Determine whether the MLS definition is empty.
Definition lms_definition.h:43
bool contains(unsigned int age, core::Gender gender) const noexcept
Determine whether the definition contains a given age by gender.
Definition lms_definition.h:61
std::size_t size() const noexcept
Gets the size of the MLS definition dataset.
Definition lms_definition.h:47
unsigned int min_age() const noexcept
Gets the definition minimum age.
Definition lms_definition.h:51
const LmsRecord & at(unsigned int age, core::Gender gender) const
Gets the model parameters for a given age and gender.
Definition lms_definition.h:74
Gender
Enumerates gender types.
Definition forward_type.h:18
Top-level namespace for Health-GPS Console host application.
Definition command_options.cpp:8
std::map< unsigned int, std::map< core::Gender, LmsRecord > > LmsDataset
Defines the LMS (lambda-mu-sigma) model dataset.
Definition lms_definition.h:23
Global namespace.
Definition column_iterator.h:123
Defines the LMS (lambda-mu-sigma) parameters record data type.
Definition lms_definition.h:11
double lambda
Lambda parameter value.
Definition lms_definition.h:13
double sigma
Sigma parameter value.
Definition lms_definition.h:19
double mu
Mu parameter value.
Definition lms_definition.h:16