Parallel PopGen Package
Sim_Model::F_mu_h_piecewise< Functor_p1, Functor_p2 > Struct Template Reference

functor: parameter function changes from p1 to p2 at generation inflection_point More...

Public Member Functions

 F_mu_h_piecewise ()
 default constructor More...
 
 F_mu_h_piecewise (Functor_p1 p1_in, Functor_p2 p2_in, int inflection_point, int generation_shift=0)
 constructor More...
 
__host__ __forceinline__ float operator() (const int population, const int generation) const
 Inbreeding/Mutation/Dominance operator, returns parameter p for a given population, generation More...
 

Public Attributes

int inflection_point
 generation in which the Inbreeding/Mutation/Dominance function switches from p1 to p2 More...
 
int generation_shift
 number of generations to shift function backwards More...
 
Functor_p1 p1
 first parameter function More...
 
Functor_p2 p2
 second parameter function More...
 

Detailed Description

template<typename Functor_p1, typename Functor_p2>
struct Sim_Model::F_mu_h_piecewise< Functor_p1, Functor_p2 >

functor: parameter function changes from p1 to p2 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 parameter functors can be nested within each other and with population specific parameter functors for multiple populations and multiple time functions, e.g.:

3 populations with different Inbreeding coefficients where populations in the 1st are outbred, in the 2nd are partially inbred, and in the 3rd are completely inbred until population becomes completely outcrossing at generation 300

typedef Sim_Model::F_mu_h_constant F_constant;
typedef Sim_Model::F_mu_h_population_specific<F_constant,F_constant> F_population_specific_constant;
F_constant outbred;
F_constant inbred(1);
F_constant mixed(0.5);
F_population_specific_constant first_second(outbred,mixed,1);
F_piecewise_constant third(inbred,outbred,300);

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 138 of file go_fish.cuh.

Constructor & Destructor Documentation

§ F_mu_h_piecewise() [1/2]

template<typename Functor_p1 , typename Functor_p2 >
Sim_Model::F_mu_h_piecewise< Functor_p1, Functor_p2 >::F_mu_h_piecewise ( )
inline

default constructor

inflection_point = 0
generation_shift = 0
Function p1 assigned default constructor of Functor_p1
Function p2 assigned default constructor of Functor_p2

Definition at line 246 of file template_inline_simulation_functors.cuh.

§ F_mu_h_piecewise() [2/2]

template<typename Functor_p1 , typename Functor_p2 >
Sim_Model::F_mu_h_piecewise< Functor_p1, Functor_p2 >::F_mu_h_piecewise ( Functor_p1  p1_in,
Functor_p2  p2_in,
int  inflection_point,
int  generation_shift = 0 
)
inline

constructor

Parameters
generation_shift(optional input) default 0

Definition at line 249 of file template_inline_simulation_functors.cuh.

Member Function Documentation

§ operator()()

template<typename Functor_p1 , typename Functor_p2 >
__host__ __forceinline__ float Sim_Model::F_mu_h_piecewise< Functor_p1, Functor_p2 >::operator() ( const int  population,
const int  generation 
) const

Inbreeding/Mutation/Dominance operator, returns parameter p for a given population, generation

if(generation >= inflection_point+generation_shift) p = p2(population, generation-generation_shift)
else p = p1(population, generation-generation_shift)

Definition at line 253 of file template_inline_simulation_functors.cuh.

Member Data Documentation

§ inflection_point

template<typename Functor_p1 , typename Functor_p2 >
int Sim_Model::F_mu_h_piecewise< Functor_p1, Functor_p2 >::inflection_point

generation in which the Inbreeding/Mutation/Dominance function switches from p1 to p2

Definition at line 140 of file go_fish.cuh.

§ generation_shift

template<typename Functor_p1 , typename Functor_p2 >
int Sim_Model::F_mu_h_piecewise< Functor_p1, Functor_p2 >::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 141 of file go_fish.cuh.

§ p1

template<typename Functor_p1 , typename Functor_p2 >
Functor_p1 Sim_Model::F_mu_h_piecewise< Functor_p1, Functor_p2 >::p1

first parameter function

Definition at line 142 of file go_fish.cuh.

§ p2

template<typename Functor_p1 , typename Functor_p2 >
Functor_p2 Sim_Model::F_mu_h_piecewise< Functor_p1, Functor_p2 >::p2

second parameter function

Definition at line 143 of file go_fish.cuh.


The documentation for this struct was generated from the following files: