Template Function fwdpp::add_mutation¶
Defined in File add_mutation.hpp
Function Documentation¶
-
template<typename
poptype, class ...Args>
std::size_tfwdpp::add_mutation(poptype &p, const std::vector<std::size_t> &indlist, const std::vector<short> &clist, Args&&... args)¶ Add a mutation into a population at a given frequency.
Some notes:
- Return
The key referring to the location of the new mutation in the population
- Parameters
p: A single locus population object.indlist: A list of indexes of diploids into which to add the new mutations.clist: A list of haploid_genomes. See below.args: Values required to cosnstruct a new mutation. See below.
clist.size() must equal indlist.size()
Values in clist must be 0, 1, or 2. These values mean to add the mutation to the first, second, or both haploid_genomes, resepectively, of each diploid in indlist.
Note that args can take on a few different forms. First, it can be a raw set of values used to construct a new mutation. Or, it can be an object of correct mutation type. Or, it can be any type from which the correct mutation type can be constructed. The last two cases require that the mutation type have the appropriate constructors defined.
See the unit test file unit/test_sugar_add_mutation.cc for example of use.