LctInfectionState< FP, InfectionStates, Ns > Class Template Reference
|
CPP API
|
Provides the functionality to be able to work with subcompartments in an LCT model. More...
#include <lct_infection_state.h>
Public Types | |
| using | InfectionState = InfectionStates |
Static Public Member Functions | |
| static Eigen::VectorX< FP > | calculate_compartments (const Eigen::VectorX< FP > &subcompartments) |
| Cumulates a vector with the number of individuals in each subcompartment (with subcompartments according to the LctInfectionState) to produce a Vector that divides the population only into the infection states defined in InfectionStates. More... | |
| template<InfectionState State> | |
| static constexpr size_t | get_first_index () |
| Gets the index of the first subcompartment of an infection state. More... | |
| template<InfectionState State> | |
| static constexpr size_t | get_num_subcompartments () |
| Gets the number of subcompartments in an infection state. More... | |
Static Public Attributes | |
| static constexpr size_t | Count {(... + Ns)} |
Static Private Attributes | |
| static constexpr const std::array< size_t, sizeof...(Ns)> | m_subcompartment_numbers |
| Vector which defines the number of subcompartments for each infection state of InfectionState. More... | |
Detailed Description
template<typename FP, class InfectionStates, size_t... Ns>
class mio::LctInfectionState< FP, InfectionStates, Ns >
Provides the functionality to be able to work with subcompartments in an LCT model.
This class just stores the number of subcompartments for each InfectionState and not the number of individuals in each subcompartment.
- Template Parameters
-
InfectionStates An enum class that defines the basic infection states. Ns Number of subcompartments for each infection state defined in InfectionState. The number of given template arguments must be equal to the entry Count from InfectionStates.
Member Typedef Documentation
◆ InfectionState
| using mio::LctInfectionState< FP, InfectionStates, Ns >::InfectionState = InfectionStates |
Member Function Documentation
◆ calculate_compartments()
|
inlinestatic |
Cumulates a vector with the number of individuals in each subcompartment (with subcompartments according to the LctInfectionState) to produce a Vector that divides the population only into the infection states defined in InfectionStates.
- Parameters
-
[in] subcompartments Vector with number of individuals in each subcompartment. The size of the vector has to match the LctInfectionState.
- Returns
- Vector with accumulated values for the InfectionStates.
◆ get_first_index()
|
inlinestaticconstexpr |
Gets the index of the first subcompartment of an infection state.
In a simulation, the number of individuals in the subcompartments are stored in vectors. Accordingly, the index of the first subcompartment of State in such a vector is returned.
- Template Parameters
-
State Infection state for which the index should be returned.
- Returns
- Index of the first subcompartment for a vector with one entry per subcompartment. Returned value is always non-negative.
◆ get_num_subcompartments()
|
inlinestaticconstexpr |
Gets the number of subcompartments in an infection state.
- Template Parameters
-
State Infection state for which the number of subcompartments should be returned.
- Returns
- Number of subcompartments for State. Returned value is always at least one.
Member Data Documentation
◆ Count
|
staticconstexpr |
◆ m_subcompartment_numbers
|
staticconstexprprivate |
Vector which defines the number of subcompartments for each infection state of InfectionState.
Generated by