Parallel PopGen Package
|
functor: demography function changes from d1
to d2
at generation inflection_point
More...
Public Member Functions | |
demography_piecewise () | |
default constructor More... | |
demography_piecewise (Functor_d1 d1_in, Functor_d2 d2_in, int inflection_point, int generation_shift=0) | |
constructor More... | |
__host__ __device__ __forceinline__ int | operator() (const int population, const int generation) const |
Demographic operator, returns population size (individuals), N , for a given population, generation More... | |
Public Attributes | |
int | inflection_point |
generation in which the Demographic function switches from d1 to d2 More... | |
int | generation_shift |
number of generations to shift function backwards More... | |
Functor_d1 | d1 |
first demographic function More... | |
Functor_d2 | d2 |
second demographic function More... | |
functor: demography function changes from d1
to d2
at generation inflection_point
Takes in two template types: the function to be returned before the inflection_point
and the function for after the inflection_point
.
Piecewise demographic functors can be nested within each other and with population specific demographic functors for multiple populations and multiple time functions, e.g.:
Using both demographic and migration functors, population 0 splits in two, forming population 1 in the first generation. Population 1's size increases exponentially afterwards with no further migration between the groups
The modularity of these functor templates allow parameter models to be extended to any number of populations and piecewise parameter functions (including user defined functions).
Definition at line 216 of file go_fish.cuh.
|
inline |
default constructor
inflection_point = 0
generation_shift = 0
Function d1
assigned default constructor of Functor_d1
Function d2
assigned default constructor of Functor_d2
Definition at line 390 of file template_inline_simulation_functors.cuh.
|
inline |
constructor
generation_shift | (optional input) default 0 |
Definition at line 393 of file template_inline_simulation_functors.cuh.
__host__ __device__ __forceinline__ int Sim_Model::demography_piecewise< Functor_d1, Functor_d2 >::operator() | ( | const int | population, |
const int | generation | ||
) | const |
Demographic operator, returns population size (individuals), N
, for a given population, generation
if(generation >= inflection_point+generation_shift) N = d2(population, generation-generation_shift)
else N = d1(population, generation-generation_shift)
Definition at line 397 of file template_inline_simulation_functors.cuh.
int Sim_Model::demography_piecewise< Functor_d1, Functor_d2 >::inflection_point |
generation in which the Demographic function switches from d1
to d2
Definition at line 218 of file go_fish.cuh.
int Sim_Model::demography_piecewise< Functor_d1, Functor_d2 >::generation_shift |
number of generations to shift function backwards
useful if you are starting the simulation from a previous simulation state and this function is expecting to start at 0 or any scenario where you want to shift the generation of the function relative to the simulation generation
Definition at line 219 of file go_fish.cuh.
Functor_d1 Sim_Model::demography_piecewise< Functor_d1, Functor_d2 >::d1 |
first demographic function
Definition at line 220 of file go_fish.cuh.
Functor_d2 Sim_Model::demography_piecewise< Functor_d1, Functor_d2 >::d2 |
second demographic function
Definition at line 221 of file go_fish.cuh.