|
FFPopSim
2.0
Library for Population Genetics
|
Hypercube class for high-dimensional simulations. More...
#include <ffpopsim_highd.h>
Public Member Functions | |
| hypercube_highd () | |
| hypercube_highd (int dim_in, int s=0) | |
| virtual | ~hypercube_highd () |
| int | set_up (int dim_in, int s=0) |
| unsigned int | get_dim () |
| unsigned int | get_seed () |
| double | get_func (boost::dynamic_bitset<> &genotype) |
| Get single value on the hypercube. More... | |
| double | get_additive_coefficient (int locus) |
| : get the trait coefficient of a locus. More... | |
| double | get_func_diff (boost::dynamic_bitset<> &genotype1, boost::dynamic_bitset<> &genotype2, vector< int > &diffpos) |
| Calculate difference between two hypercube points efficiently. More... | |
| void | reset () |
| Reset the hypercube. More... | |
| void | reset_additive () |
| Reset the additive part of the hypercube. More... | |
| int | set_additive_coefficient (double value, int locus, int expected_locus=-1) |
| reset the value of an additive coefficient More... | |
| int | add_coefficient (double value, vector< int > loci) |
| assign single- or multi-locus trait coefficients. More... | |
| int | set_random_epistasis_strength (double sigma) |
| set the standard deviation of random epistatic fitness More... | |
Public Attributes | |
| int | rng_offset |
| int | dim |
| double | hypercube_mean |
| double | epistatic_std |
| vector< coeff_single_locus_t > | coefficients_single_locus |
| vector< coeff_t > | coefficients_epistasis |
Hypercube class for high-dimensional simulations.
This class is used for representing properties of genotypes. Unlike the low-dimensional sister class, no attempt is made to monitor the whole hypercube, because the dimension the space of genotypes of length L is \(2^L\). As a consequence, no Fourier transformations are implemented.
The main use of this class is either for pointwise assigment of values (for instance, we assign fitness only for the actually observed genotypes) or for low-order Fourier coefficients, like like main fitness effects and two-site epistasis, which scale like L and \(L^2\), respectively.
| hypercube_highd::hypercube_highd | ( | ) |
| hypercube_highd::hypercube_highd | ( | int | dim_in, |
| int | s = 0 |
||
| ) |

|
virtual |
| int hypercube_highd::add_coefficient | ( | double | value, |
| vector< int > | loci | ||
| ) |
assign single- or multi-locus trait coefficients.
It takes a double and assigns it to a trait coefficients with index set specified in vector loci.
| double hypercube_highd::get_additive_coefficient | ( | int | locus | ) |
: get the trait coefficient of a locus.
Loop over the additive coefficients and return the value once the locus is found.

|
inline |
| double hypercube_highd::get_func | ( | boost::dynamic_bitset<> & | genotype | ) |
Get single value on the hypercube.
| genotype | Point of the hypercube |

| double hypercube_highd::get_func_diff | ( | boost::dynamic_bitset<> & | genotype1, |
| boost::dynamic_bitset<> & | genotype2, | ||
| vector< int > & | diffpos | ||
| ) |
Calculate difference between two hypercube points efficiently.
| genotype1 | first point on the hypercube |
| genotype2 | second point on the hypercube |
| diffpos | vector of positions at which they differ |


|
inline |
| void hypercube_highd::reset | ( | ) |
Reset the hypercube.


| void hypercube_highd::reset_additive | ( | ) |
Reset the additive part of the hypercube.

| int hypercube_highd::set_additive_coefficient | ( | double | value, |
| int | lindex, | ||
| int | expected_locus = -1 |
||
| ) |
reset the value of an additive coefficient
Note: it requires the index of the coefficient and the locus it is supposed to refer to.

| int hypercube_highd::set_random_epistasis_strength | ( | double | sigma | ) |
set the standard deviation of random epistatic fitness
| int hypercube_highd::set_up | ( | int | dim_in, |
| int | s = 0 |
||
| ) |

| vector<coeff_t> hypercube_highd::coefficients_epistasis |
| vector<coeff_single_locus_t> hypercube_highd::coefficients_single_locus |
| int hypercube_highd::dim |
| double hypercube_highd::epistatic_std |
| double hypercube_highd::hypercube_mean |
| int hypercube_highd::rng_offset |