Defines the relative risk factors lookup data type.
More...
#include <relative_risk.h>
Defines the relative risk factors lookup data type.
- Note
- When a lookup value does not exists at the exact breakpoint values provided, a data at bound value or a linear interpolated value is returned for the operation.
◆ RelativeRiskLookup() [1/2]
hgps::RelativeRiskLookup::RelativeRiskLookup |
( |
| ) |
|
|
delete |
◆ RelativeRiskLookup() [2/2]
Initialises a new instance of the RelativeRiskLookup class.
- Parameters
-
rows | The rows lookup breakpoints |
cols | The columns lookup breakpoints |
values | The lookup data values |
- Exceptions
-
std::out_of_range | for lookup breakpoints and values size mismatch. |
◆ at()
float hgps::RelativeRiskLookup::at |
( |
const int |
age, |
|
|
const float |
value |
|
) |
| const |
Lookup a value at specific breakpoints with bounds checking.
- Parameters
-
age | The row value |
value | The column value |
- Returns
- The lookup value
- Exceptions
-
std::out_of_range | for row breakpoint value outside of the bounds. |
◆ columns()
std::size_t hgps::RelativeRiskLookup::columns |
( |
| ) |
const |
|
noexcept |
Gets the number of columns lookup breakpoints.
- Returns
- Number of columns
◆ contains()
bool hgps::RelativeRiskLookup::contains |
( |
const int |
age, |
|
|
const float |
value |
|
) |
| const |
|
noexcept |
Checks if the lookup contains a value with specific breakpoints.
- Parameters
-
age | The row value |
value | The column value |
- Returns
- true if there is such a value; otherwise, false.
◆ empty()
bool hgps::RelativeRiskLookup::empty |
( |
| ) |
const |
|
noexcept |
Checks if the lookup has no data.
- Returns
- true if the lookup data is empty; otherwise, false.
◆ operator()()
float hgps::RelativeRiskLookup::operator() |
( |
const int |
age, |
|
|
const float |
value |
|
) |
| const |
Lookup a value at specific breakpoints with bounds checking.
- Parameters
-
age | The row value |
value | The column value |
- Returns
- The lookup value
- Exceptions
-
std::out_of_range | for row breakpoint value outside of the bounds. |
◆ rows()
std::size_t hgps::RelativeRiskLookup::rows |
( |
| ) |
const |
|
noexcept |
Gets the number of rows lookup breakpoints.
- Returns
- Number of rows
◆ size()
std::size_t hgps::RelativeRiskLookup::size |
( |
| ) |
const |
|
noexcept |
Gets the number of elements in the lookup dataset.
- Returns
- Number of lookup elements.
The documentation for this class was generated from the following files: