Parallel PopGen Package
|
functor: migration function changes from m1
to m2
at generation inflection_point
More...
Public Member Functions | |
migration_piecewise () | |
default constructor More... | |
migration_piecewise (Functor_m1 m1_in, Functor_m2 m2_in, int inflection_point, int generation_shift=0) | |
constructor More... | |
__host__ __device__ __forceinline__ float | operator() (const int pop_FROM, const int pop_TO, const int generation) const |
Migration operator, returns migration rate, mig_rate , which is the proportion of chromosomes in pop_TO from pop_FROM for a given generation More... | |
Public Attributes | |
int | inflection_point |
generation in which the migration function switches from m1 to m2 More... | |
int | generation_shift |
number of generations to shift function backwards More... | |
Functor_m1 | m1 |
first migration function More... | |
Functor_m2 | m2 |
second migration function More... | |
functor: migration function changes from m1
to m2
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 migration functors can be nested within each other and with constant directional migration functors for multiple migration directions 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 256 of file go_fish.cuh.
|
inline |
default constructor
inflection_point = 0
generation_shift = 0
Function m1
assigned default constructor of Functor_m1
Function m2
assigned default constructor of Functor_m2
Definition at line 514 of file template_inline_simulation_functors.cuh.
|
inline |
constructor
generation_shift | (optional input) default 0 |
Definition at line 517 of file template_inline_simulation_functors.cuh.
__host__ __device__ __forceinline__ float Sim_Model::migration_piecewise< Functor_m1, Functor_m2 >::operator() | ( | const int | pop_FROM, |
const int | pop_TO, | ||
const int | generation | ||
) | const |
Migration operator, returns migration rate, mig_rate
, which is the proportion of chromosomes in pop_TO
from pop_FROM
for a given generation
if(generation >= inflection_point+generation_shift) mig_rate = m2(pop_FROM, pop_TO, generation-generation_shift)
else mig_rate = m1(pop_FROM, pop_TO, generation-generation_shift)
Definition at line 521 of file template_inline_simulation_functors.cuh.
int Sim_Model::migration_piecewise< Functor_m1, Functor_m2 >::inflection_point |
generation in which the migration function switches from m1
to m2
Definition at line 258 of file go_fish.cuh.
int Sim_Model::migration_piecewise< Functor_m1, Functor_m2 >::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 259 of file go_fish.cuh.
Functor_m1 Sim_Model::migration_piecewise< Functor_m1, Functor_m2 >::m1 |
first migration function
Definition at line 260 of file go_fish.cuh.
Functor_m2 Sim_Model::migration_piecewise< Functor_m1, Functor_m2 >::m2 |
second migration function
Definition at line 261 of file go_fish.cuh.