24 throw std::invalid_argument(
"The risk factors adjustment table must not be empty.");
26 throw std::out_of_range(
27 "The risk factors adjustment definition must contain two tables.");
31 throw std::invalid_argument(
"Missing the required adjustment table for male.");
33 throw std::invalid_argument(
"Missing the required adjustment table for female.");
45 bool empty() const noexcept {
return count_ < 1; }
48 int count() const noexcept {
return count_; }
51 double sum() const noexcept {
return sum_; }
55 double mean() const noexcept {
bool contains(const TROW &row_key) const
Determines whether the container contains a row.
Definition: map2d.h:52
bool empty() const noexcept
Determine whether the container is empty.
Definition: map2d.h:27
std::size_t rows() const noexcept
Gets the number of rows.
Definition: map2d.h:35
Top-level namespace for Health-GPS C++ API.
Definition: analysis_definition.h:8
Global namespace.
Definition: jsonparser.h:88
Defines the risk factor baseline adjustment data type.
Definition: riskfactor_adjustment_types.h:14
BaselineAdjustment()=default
Initialises a new instance of the BaselineAdjustment structure.
FactorAdjustmentTable values
The risk factors adjustment table values.
Definition: riskfactor_adjustment_types.h:38
BaselineAdjustment(FactorAdjustmentTable &&adjustment_table)
Initialises a new instance of the BaselineAdjustment structure.
Definition: riskfactor_adjustment_types.h:21
Defines the first statistical moment type.
Definition: riskfactor_adjustment_types.h:42
auto operator<=>(const FirstMoment &other) const =default
Compare FirstMoment instances.
void append(double value) noexcept
Appends a value to the moment.
Definition: riskfactor_adjustment_types.h:65
double mean() const noexcept
Gets the values mean.
Definition: riskfactor_adjustment_types.h:55
double sum() const noexcept
Gets the values sum.
Definition: riskfactor_adjustment_types.h:51
void clear() noexcept
Clear the moment.
Definition: riskfactor_adjustment_types.h:71
bool empty() const noexcept
Determine whether the moment is empty.
Definition: riskfactor_adjustment_types.h:45
int count() const noexcept
Gets the number of values added to the moment.
Definition: riskfactor_adjustment_types.h:48