lct_populations.h Source File
|
CPP API
|
lct_populations.h
Go to the documentation of this file.
112 static_assert((Group < num_groups) && (Group >= 0), "The template parameter Group should be valid.");
117 return get_first_index_of_group<Group - 1>() + type_at_index_t<Group - 1, LctStatesGroups>::Count;
A class template for compartment populations of LCT models.
Definition: lct_populations.h:57
FP get_group_total() const
Returns the total population of a group.
Definition: lct_populations.h:136
FP get_total() const
Returns the total population of all compartments and groups.
Definition: lct_populations.h:147
size_t get_first_index_of_group() const
Gets the first index of a group in the flat array.
Definition: lct_populations.h:110
static size_t get_count()
Sets recursively the total number of (sub-)compartments over all groups.
Definition: lct_populations.h:201
bool check_constraints() const
Checks whether all compartments have non-negative values and logs an error if constraint is not satis...
Definition: lct_populations.h:186
Type & operator[](size_t index)
Returns the entry of the array given a flat index.
Definition: lct_populations.h:98
size_t get_num_compartments() const
get_num_compartments Returns the number of compartments.
Definition: lct_populations.h:75
static constexpr size_t num_groups
Number of groups.
Definition: lct_populations.h:62
LctPopulations()
Default constructor.
Definition: lct_populations.h:66
bool apply_constraints()
Checks whether all compartments have non-negative values.
Definition: lct_populations.h:164
auto const & array() const
Returns a reference to the internally stored flat array.
Definition: lct_populations.h:84
Eigen::VectorX< FP > get_compartments() const
Returns an Eigen copy of the vector of populations.
Definition: lct_populations.h:125
Eigen::Array< Type, Eigen::Dynamic, 1 > InternalArrayType
Definition: lct_populations.h:60
A collection of classes to simplify handling of matrix shapes in meta programming.
Definition: models/abm/analyze_result.h:30
void log_warning(spdlog::string_view_t fmt, const Args &... args)
Definition: logging.h:112
typename type_at_index< Index, Types... >::type type_at_index_t
The type at the Index-th position in the list Types.
Definition: metaprogramming.h:118
void log_error(spdlog::string_view_t fmt, const Args &... args)
Definition: logging.h:100
Collection of types. Each type is mapped to an index of type size_t.
Definition: type_list.h:32
Generated by