29 std::size_t
size() const noexcept;
33 std::
size_t rows() const noexcept;
41 bool empty() const noexcept;
48 float at(const
int age, const
float value) const;
55 float operator()(const
int age, const
float value) const;
66 bool contains(const
int age, const
float value) const noexcept;
69 core::FloatArray2D table_;
70 std::map<
int,
int> rows_index_;
71 std::map<
float,
int> cols_index_;
73 float lookup_value(const
int age, const
float value) const;
92 int age,
core::Gender gender,
float value);
Defines a monotonic vector container type.
Definition monotonic_vector.h:42
Defines the relative risk factors lookup data type.
Definition relative_risk.h:15
std::size_t size() const noexcept
Gets the number of elements in the lookup dataset.
Definition relative_risk.cpp:40
RelativeRiskLookup()=delete
bool contains_age(const int age) const noexcept
True when the table has a row for this age.
Definition relative_risk.cpp:58
float at(const int age, const float value) const
Lookup a value at specific breakpoints with bounds checking.
Definition relative_risk.cpp:50
bool empty() const noexcept
Checks if the lookup has no data.
Definition relative_risk.cpp:46
std::size_t rows() const noexcept
Gets the number of rows lookup breakpoints.
Definition relative_risk.cpp:42
bool contains(const int age, const float value) const noexcept
Checks if the lookup contains a value with specific breakpoints.
Definition relative_risk.cpp:62
std::size_t columns() const noexcept
Gets the number of columns lookup breakpoints.
Definition relative_risk.cpp:44
Top-level namespace for Health-GPS Core C++ API.
Definition analysis.h:7
Array2D< float > FloatArray2D
Contiguous storage for two-dimensional single precision values.
Definition array2d.h:139
Top-level namespace for Health-GPS Console host application.
Definition command_options.cpp:9
std::map< core::Identifier, std::map< core::Gender, RelativeRiskLookup > > RelativeRiskLookupMap
Defines the relative risk factor lookup type.
Definition relative_risk.h:80
float require_relative_risk(const RelativeRiskLookup &lookup, const core::Identifier &factor, int age, core::Gender gender, float value)
Read one relative-risk cell, or throw a message that names the factor, age, and sex.
Definition relative_risk.cpp:70
std::map< core::Identifier, FloatAgeGenderTable > RelativeRiskTableMap
Defines the relative risk factor table type.
Definition relative_risk.h:77
AgeGenderTable< float > FloatAgeGenderTable
Age and Gender lookup table for single precision floating-point values.
Definition gender_table.h:180
Global namespace.
Definition column_iterator.h:123
Defines the relative risk factors data type.
Definition relative_risk.h:95
RelativeRiskLookupMap risk_factors
Risk factor to diseases relative risk values.
Definition relative_risk.h:100
RelativeRiskTableMap diseases
Disease to diseases relative risk values.
Definition relative_risk.h:97