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

#include <quetzal/demography/FlowOnDiskImplementation.hpp>

Detailed Description

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

Defines a template class to store the demographic flows number across a landscape along time.

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

Classes

struct  key_hash
 Makes key_type hashable in unordered_map. More...
 
struct  key_type
 The type of key for nested map member. More...
 

Public Types

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

Public Member Functions

 FlowOnDiskImplementation ()=default
 Default constructor.
 
value_type flow_from_to (coord_type const &from, coord_type const &to, time_type t) const
 Retrieves value of the flow from deme i to deme j at time t.
 
void set_flow_from_to (coord_type const &from, coord_type const &to, time_type t, value_type v)
 Retrieves value of the flow from deme i to deme j at time t.
 
void add_to_flow_from_to (coord_type const &from, coord_type const &to, time_type t, value_type v)
 Adds value v to the flow from deme i to deme j at time t.
 
std::unordered_map< coord_type, value_type > const & flow_to (coord_type const &x, time_type t) const
 Retrieves the distribution of the value of the flow converging to deme x at time t.
 
bool flow_to_is_defined (coord_type const &to, time_type const &t) const
 Check if the distribution of the value of the flow converging to deme x at time t is defined.
 

Member Function Documentation

◆ flow_to()

template<typename Space , typename Time , typename Value >
std::unordered_map< coord_type, value_type > const & quetzal::demography::FlowOnDiskImplementation< Space, Time, Value >::flow_to ( coord_type const &  x,
time_type  t 
) const
inline

Retrieves the distribution of the value of the flow converging to deme x at time t.

Returns
a const reference on an unordered_map with the key giving the origin deme and the value giving the value of the flow

◆ flow_to_is_defined()

template<typename Space , typename Time , typename Value >
bool quetzal::demography::FlowOnDiskImplementation< Space, Time, Value >::flow_to_is_defined ( coord_type const &  to,
time_type const &  t 
) const
inline

Check if the distribution of the value of the flow converging to deme x at time t is defined.

Returns
true if the distribution is defined, else returns false

◆ set_flow_from_to()

template<typename Space , typename Time , typename Value >
void quetzal::demography::FlowOnDiskImplementation< Space, Time, Value >::set_flow_from_to ( coord_type const &  from,
coord_type const &  to,
time_type  t,
value_type  v 
)
inline

Retrieves value of the flow from deme i to deme j at time t.

Returns
a reference on the value, initialized with value_type default constructor

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