Template Struct haploid_genome_base

Struct Documentation

template<typename TAG = tags::standard_haploid_genome>
struct fwdpp::haploid_genome_base

Base class for genomes.

A haploid_genome contains one container of keys to neutral mutations, and another to selected mutations. It also keeps track of its count (number of occurrences).

The template parameter types are: tag_type = A type that can be used as a “dispatch tag”. Currently, these are not used elsewhere in the library, but they may be in the future, or this may disappear in future library releases.

Public Types

using haploid_genome_tag = TAG

Dispatch tag type.

using mutation_container = std::vector<uint_t>

Container type for mutation indexes.

using index_t = typename mutation_container::value_type

The integer type used to store mutation indexes.

using constructor_tuple = std::tuple<uint_t, mutation_container, mutation_container>

Tuple type usable for construction.

Public Functions

haploid_genome_base(const uint_t &icount) noexcept

Constructor.

Parameters
  • icount: The number of occurrences of this haploid_genome in the population

template<typename T>
haploid_genome_base(const uint_t &icount, T &&n, T &&s) noexcept

“Perfect-forwarding” constructor

Parameters
  • icount: The number of occurrences of this haploid_genome in the population

  • n: A container of mutations not affecting trait value/fitness

  • s: A container of mutations affecting trait value/fitness

haploid_genome_base(constructor_tuple t)

Construct from n, mutations, smutations tuple.

~haploid_genome_base() noexcept

Destructor is virtual, so you may inherit from this type.

haploid_genome_base(haploid_genome_base const&) = default

Copy constructor.

haploid_genome_base(haploid_genome_base&&) = default

Move constructor.

haploid_genome_base &operator=(haploid_genome_base const&) = default

Assignment operator.

haploid_genome_base &operator=(haploid_genome_base&&) = default

Move assignment operator.

bool operator==(const haploid_genome_base<TAG> &rhs) const

Equality operation.

Public Members

uint_t n

Count in population.

mutation_container mutations

Container of mutations not affecting trait value/fitness.

mutation_container smutations

Container of mutations affecting trait value/fitness.