Parallel PopGen Package
|
functor: selection function changes from s1
to s2
at generation inflection_point
More...
Public Member Functions | |
selection_piecewise () | |
default constructor More... | |
selection_piecewise (Functor_sel1 s1_in, Functor_sel2 s2_in, int inflection_point, int generation_shift=0) | |
constructor More... | |
__device__ __forceinline__ float | operator() (const int population, const int generation, const float freq) const |
selection operator, returns selection coefficient, s , for a given population, generation, freq More... | |
Public Attributes | |
int | inflection_point |
generation in which the selection function switches from s1 to s2 More... | |
int | generation_shift |
number of generations to shift function backwards More... | |
Functor_sel1 | s1 |
first selection function More... | |
Functor_sel2 | s2 |
second selection function More... | |
functor: selection function changes from s1
to s2
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 selection functors can be nested within each other and with population specific selection functors for multiple populations and multiple time functions, e.g.:
3 populations with different selection coefficients where mutations in the 1st are neutral, in the 2nd are deleterious, and in the 3rd are beneficial up to generation 300 when selection relaxes and they become neutral
The modularity of these functor templates allow selection models to be extended to any number of populations and piecewise selection functions (including user defined functions).
Definition at line 85 of file go_fish.cuh.
|
inline |
default constructor
inflection_point = 0
generation_shift = 0
Function s1
assigned default constructor of Functor_sel1
Function s2
assigned default constructor of Functor_sel2
Definition at line 148 of file template_inline_simulation_functors.cuh.
|
inline |
constructor
generation_shift | (optional input) default 0 |
Definition at line 151 of file template_inline_simulation_functors.cuh.
__device__ __forceinline__ float Sim_Model::selection_piecewise< Functor_sel1, Functor_sel2 >::operator() | ( | const int | population, |
const int | generation, | ||
const float | freq | ||
) | const |
selection operator, returns selection coefficient, s
, for a given population, generation, freq
if(generation >= inflection_point+generation_shift) s = s2(population, generation-generation_shift, freq)
else s = s1(population, generation-generation_shift, freq)
Definition at line 155 of file template_inline_simulation_functors.cuh.
int Sim_Model::selection_piecewise< Functor_sel1, Functor_sel2 >::inflection_point |
generation in which the selection function switches from s1
to s2
Definition at line 87 of file go_fish.cuh.
int Sim_Model::selection_piecewise< Functor_sel1, Functor_sel2 >::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 88 of file go_fish.cuh.
Functor_sel1 Sim_Model::selection_piecewise< Functor_sel1, Functor_sel2 >::s1 |
first selection function
Definition at line 89 of file go_fish.cuh.
Functor_sel2 Sim_Model::selection_piecewise< Functor_sel1, Functor_sel2 >::s2 |
second selection function
Definition at line 90 of file go_fish.cuh.