Parallel PopGen Package
|
functor: returns the result of function f1
until generation inflection_point
, then returns the result of function f2
More...
Public Member Functions | |
bool_piecewise () | |
default constructor More... | |
bool_piecewise (int inflection_point, int generation_shift=0) | |
constructor More... | |
bool_piecewise (Functor_first f1_in, Functor_second f2_in, int inflection_point, int generation_shift=0) | |
constructor More... | |
__host__ __forceinline__ bool | operator() (const int generation) const |
Preserving and Sampling operator, returns boolean b to turn on/off preserving and sampling in generation generation of the simulation. More... | |
Public Attributes | |
int | inflection_point |
generation in which the boolean function switches from f1 to f2 More... | |
int | generation_shift |
number of generations to shift function backwards More... | |
Functor_first | f1 |
first boolean function More... | |
Functor_second | f2 |
second boolean function More... | |
functor: returns the result of function f1
until generation inflection_point
, then returns the result of function f2
Takes in two template types: the function to be returned before the inflection_point
and the function for after the inflection_point
.
Piecewise bool functors can be nested within each other and with pulse bool functors for a myriad of different sampling and preserving strategies, e.g.:
Sampling strategy that takes time samples of generation 0 & generations [100,110] inclusive (& final generation is always sampled).
Note mutations present in these generations will be preserved until the final generation of the simulation.
Definition at line 311 of file go_fish.cuh.
|
inline |
default constructor
inflection_point = 0
generation_shift = 0
Function f1
assigned default constructor of Functor_first
Function f2
assigned default constructor of Functor_second
Definition at line 636 of file template_inline_simulation_functors.cuh.
|
inline |
constructor
Function f1
assigned default constructor of Functor_first
Function f2
assigned default constructor of Functor_second
generation_shift | (optional input) default 0 |
Definition at line 641 of file template_inline_simulation_functors.cuh.
|
inline |
constructor
generation_shift | (optional input) default 0 |
Definition at line 644 of file template_inline_simulation_functors.cuh.
__host__ __forceinline__ bool Sim_Model::bool_piecewise< Functor_first, Functor_second >::operator() | ( | const int | generation | ) | const |
Preserving and Sampling operator, returns boolean b
to turn on/off preserving and sampling in generation generation
of the simulation.
if(generation >= inflection_point+generation_shift) b = f2(generation)
else b = f1(generation)
Definition at line 649 of file template_inline_simulation_functors.cuh.
int Sim_Model::bool_piecewise< Functor_first, Functor_second >::inflection_point |
generation in which the boolean function switches from f1
to f2
Definition at line 312 of file go_fish.cuh.
int Sim_Model::bool_piecewise< Functor_first, Functor_second >::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 313 of file go_fish.cuh.
Functor_first Sim_Model::bool_piecewise< Functor_first, Functor_second >::f1 |
first boolean function
Definition at line 314 of file go_fish.cuh.
Functor_second Sim_Model::bool_piecewise< Functor_first, Functor_second >::f2 |
second boolean function
Definition at line 315 of file go_fish.cuh.