Health-GPS 3.0.0.0
Global Health Policy Simulation model (Health-GPS)
Loading...
Searching...
No Matches
hgps::RelativeRiskLookup Class Reference

Defines the relative risk factors lookup data type. More...

#include <relative_risk.h>

Public Member Functions

 RelativeRiskLookup ()=delete
 RelativeRiskLookup (const MonotonicVector< int > &rows, const MonotonicVector< float > &cols, core::FloatArray2D &&values)
 Initialises a new instance of the RelativeRiskLookup class.
std::size_t size () const noexcept
 Gets the number of elements in the lookup dataset.
std::size_t rows () const noexcept
 Gets the number of rows lookup breakpoints.
std::size_t columns () const noexcept
 Gets the number of columns lookup breakpoints.
bool empty () const noexcept
 Checks if the lookup has no data.
float at (const int age, const float value) const
 Lookup a value at specific breakpoints with bounds checking.
float operator() (const int age, const float value) const
 Lookup a value at specific breakpoints with bounds checking.
bool contains_age (const int age) const noexcept
 True when the table has a row for this age.
bool contains (const int age, const float value) const noexcept
 Checks if the lookup contains a value with specific breakpoints.

Detailed Description

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.

Constructor & Destructor Documentation

◆ RelativeRiskLookup() [1/2]

hgps::RelativeRiskLookup::RelativeRiskLookup ( )
delete
Here is the call graph for this function:

◆ RelativeRiskLookup() [2/2]

hgps::RelativeRiskLookup::RelativeRiskLookup ( const MonotonicVector< int > & rows,
const MonotonicVector< float > & cols,
core::FloatArray2D && values )

Initialises a new instance of the RelativeRiskLookup class.

Parameters
rowsThe rows lookup breakpoints
colsThe columns lookup breakpoints
valuesThe lookup data values
Exceptions
std::out_of_rangefor lookup breakpoints and values size mismatch.
Here is the call graph for this function:

Member Function Documentation

◆ at()

float hgps::RelativeRiskLookup::at ( const int age,
const float value ) const

Lookup a value at specific breakpoints with bounds checking.

Parameters
ageThe row value
valueThe column value
Returns
The lookup value
Exceptions
std::out_of_rangefor row breakpoint value outside of the bounds.
Here is the caller graph for this function:

◆ columns()

std::size_t hgps::RelativeRiskLookup::columns ( ) const
noexcept

Gets the number of columns lookup breakpoints.

Returns
Number of columns
Here is the caller graph for this function:

◆ contains()

bool hgps::RelativeRiskLookup::contains ( const int age,
const float value ) const
noexcept

Checks if the lookup contains a value with specific breakpoints.

Parameters
ageThe row value
valueThe column value
Returns
true if there is such a value; otherwise, false.
Here is the caller graph for this function:

◆ contains_age()

bool hgps::RelativeRiskLookup::contains_age ( const int age) const
noexcept

True when the table has a row for this age.

Parameters
ageRow breakpoint to test.
Returns
true when age is a row in the table.
Here is the caller graph for this function:

◆ empty()

bool hgps::RelativeRiskLookup::empty ( ) const
noexcept

Checks if the lookup has no data.

Returns
true if the lookup data is empty; otherwise, false.
Here is the caller graph for this function:

◆ operator()()

float hgps::RelativeRiskLookup::operator() ( const int age,
const float value ) const

Lookup a value at specific breakpoints with bounds checking.

Parameters
ageThe row value
valueThe column value
Returns
The lookup value
Exceptions
std::out_of_rangefor 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
Here is the caller graph for this function:

◆ 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: