An occupancy spectrum as defined in Becheler & Knowles, 2020.
To understand the implementation of occupancy spectrum concept as applied to the coalescent, it is useful to consider the coalescence process as an urn and balls experiment where \(n\) balls (lineages) are randomly assigned to \(m\) urns (parents), each urn having an assignment probability of \(m−1\). If an urn contains \(r\) balls at the end of a random experiment, \(r\) is said to be the occupancy number of the urn (see Johnson and Kotz, 1977).
The number of urns having the same occupancy number \(r\) is denoted \(M_r\) and the term occupancy spectrum refers to the vector \(M_0, M_1,\dots , M_n\).
This is an useful abstraction to separate modules that are responsible for randomely producing spectrums (coalescence::occupancy_spectrum::generation_policy) from modules that consume them (coalescence::algorithm::simultaneous_multiple_merge).
|
| OccupancySpectrum (std::vector< int > const &v, int k, int N) |
| Constructor by copy.
|
|
| OccupancySpectrum (std::vector< int > &&v, int k, int N) |
| Move constructor.
|
|
| OccupancySpectrum ()=delete |
| Deleted default constructor.
|
|
| OccupancySpectrum (const OccupancySpectrum &other)=default |
| Default copy constructor.
|
|
| OccupancySpectrum (OccupancySpectrum &&other) noexcept |
| Move constructor.
|
|
OccupancySpectrum & | operator= (const OccupancySpectrum &other) |
| Copy assignment operator.
|
|
OccupancySpectrum & | operator= (OccupancySpectrum &&other) |
| Move assignment operator.
|
|
iterator | begin () |
| returns iterator to the beginning of the spectrum
|
|
iterator | end () |
| returns iterator to the end of the spectrum
|
|
const_iterator | begin () const |
| returns iterator to the beginning of the spectrum
|
|
const_iterator | end () const |
| returns iterator to the end of the spectrum
|
|
const_iterator | cbegin () const |
| returns iterator to the beginning of the spectrum
|
|
const_iterator | cend () const |
| returns iterator to the end of the spectrum
|
|
void | erase (iterator first, iterator last) |
| erase a range of elements of the spectrum.
|
|
bool | empty () const |
| Returns whether the spectrum is empty (i.e. whether its size is 0).
|
|