Parallel PopGen Package
Sim_Model::F_mu_h_population_specific< Functor_p, Functor_p_pop > Struct Template Reference

functor: one population, pop, has a different, parameter function, p_pop, all others have function p More...

Public Member Functions

 F_mu_h_population_specific ()
 default constructor More...
 
 F_mu_h_population_specific (Functor_p p_in, Functor_p_pop p_pop_in, int pop, 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 pop
 population with specific parameter function More...
 
int generation_shift
 number of generations to shift function backwards More...
 
Functor_p p
 parameter function applied to all other populations More...
 
Functor_p_pop p_pop
 population specific parameter function for pop More...
 

Detailed Description

template<typename Functor_p, typename Functor_p_pop>
struct Sim_Model::F_mu_h_population_specific< Functor_p, Functor_p_pop >

functor: one population, pop, has a different, parameter function, p_pop, all others have function p

Takes in two template types: the function to be returned for the rest of the populations and the function for the specific population, pop.
Population specific parameter functors can be nested within each other and with piecewise 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 125 of file go_fish.cuh.

Constructor & Destructor Documentation

§ F_mu_h_population_specific() [1/2]

template<typename Functor_p , typename Functor_p_pop >
Sim_Model::F_mu_h_population_specific< Functor_p, Functor_p_pop >::F_mu_h_population_specific ( )
inline

default constructor

pop = 0
generation_shift = 0
Function p assigned default constructor of Functor_p
Function p_pop assigned default constructor of Functor_p_pop

Definition at line 213 of file template_inline_simulation_functors.cuh.

§ F_mu_h_population_specific() [2/2]

template<typename Functor_p , typename Functor_p_pop >
Sim_Model::F_mu_h_population_specific< Functor_p, Functor_p_pop >::F_mu_h_population_specific ( Functor_p  p_in,
Functor_p_pop  p_pop_in,
int  pop,
int  generation_shift = 0 
)
inline

constructor

Parameters
generation_shift(optional input) default 0

Definition at line 216 of file template_inline_simulation_functors.cuh.

Member Function Documentation

§ operator()()

template<typename Functor_p , typename Functor_p_pop >
__host__ __forceinline__ float Sim_Model::F_mu_h_population_specific< Functor_p, Functor_p_pop >::operator() ( const int  population,
const int  generation 
) const

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

if(pop == population) p = p_pop(population, generation-generation_shift)
else p = p(population, generation-generation_shift)

Definition at line 220 of file template_inline_simulation_functors.cuh.

Member Data Documentation

§ pop

template<typename Functor_p, typename Functor_p_pop>
int Sim_Model::F_mu_h_population_specific< Functor_p, Functor_p_pop >::pop

population with specific parameter function

Definition at line 127 of file go_fish.cuh.

§ generation_shift

template<typename Functor_p, typename Functor_p_pop>
int Sim_Model::F_mu_h_population_specific< Functor_p, Functor_p_pop >::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 128 of file go_fish.cuh.

§ p

template<typename Functor_p, typename Functor_p_pop>
Functor_p Sim_Model::F_mu_h_population_specific< Functor_p, Functor_p_pop >::p

parameter function applied to all other populations

Definition at line 129 of file go_fish.cuh.

§ p_pop

template<typename Functor_p, typename Functor_p_pop>
Functor_p_pop Sim_Model::F_mu_h_population_specific< Functor_p, Functor_p_pop >::p_pop

population specific parameter function for pop

Definition at line 130 of file go_fish.cuh.


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