Quetzal-CoaTL
The Coalescence Template Library
Loading...
Searching...
No Matches
quetzal::demography::PopulationSizeHashMapImplementation< Space, Time, Value > Class Template Reference

#include <quetzal/demography/PopulationSizeHashMapImplementation.hpp>

Detailed Description

template<typename Space, typename Time, typename Value>
class quetzal::demography::PopulationSizeHashMapImplementation< Space, Time, Value >

Population size distribution in time and space.

Template Parameters
SpaceDemes identifiers.
TimeEqualityComparable, CopyConstructible.
ValueThe type of the population size variable (int, unsigned int, double...)

Public Types

using time_type = Time
 
using coord_type = Space
 
using value_type = Value
 

Public Member Functions

 PopulationSizeHashMapImplementation ()=default
 Default constructor.
 
void set (coord_type const &x, time_type const &t, value_type N)
 Set population size value at deme x at time t.
 
value_type get (coord_type const &x, time_type const &t) const
 Get population size value at deme x at time t.
 
value_type operator() (coord_type const &x, time_type const &t) const
 Get population size at deme x at time t.
 
value_type & operator() (coord_type const &x, time_type const &t)
 Population size at deme x at time t.
 
std::vector< coord_type > definition_space (time_type const &t) const
 Return the demes at which the population size was defined (>0) at time t.
 
bool is_defined (coord_type const &x, time_type const &t) const
 Checks if population size is defined at deme x at time t.
 

Member Function Documentation

◆ is_defined()

bool quetzal::demography::PopulationSizeHashMapImplementation< Space, Time, Value >::is_defined ( coord_type const x,
time_type const t 
) const
inline

Checks if population size is defined at deme x at time t.

Returns
True if variable is defined, else false.

◆ operator()() [1/2]

value_type & quetzal::demography::PopulationSizeHashMapImplementation< Space, Time, Value >::operator() ( coord_type const x,
time_type const t 
)
inline

Population size at deme x at time t.

Returns
a reference to the value, initialized with value_type default constructor
Remarks
operator allows for more expressive mathematical style in client code

◆ operator()() [2/2]

value_type quetzal::demography::PopulationSizeHashMapImplementation< Space, Time, Value >::operator() ( coord_type const x,
time_type const t 
) const
inline

Get population size at deme x at time t.

Remarks
operator allows for more expressive mathematical style in client code

The documentation for this class was generated from the following file: