Generic algorithms for manipulating abstract coalescent trees.
More...
|
template<class BidirectionalIterator , class T , class BinaryOperation , class Generator > |
BidirectionalIterator | binary_merge (BidirectionalIterator first, BidirectionalIterator last, T init, BinaryOperation op, Generator &g) |
| merges 2 randomly selected elements in a range.
|
|
template<class BidirectionalIterator , class Generator > |
BidirectionalIterator | binary_merge (BidirectionalIterator first, BidirectionalIterator last, Generator &g) |
| merges 2 randomly selected elements in a range, using sum operand between elements.
|
|
template<class BidirectionalIterator , class T , class BinaryOperation , class OccupancySpectrum , class Generator > |
BidirectionalIterator | simultaneous_multiple_merge (BidirectionalIterator first, BidirectionalIterator last, T init, OccupancySpectrum const &sp, BinaryOperation op, Generator &g) |
| merges randomly selected elements in a range according to an occupancy spectrum.
|
|
template<class BidirectionalIterator , class OccupancySpectrum , class Generator > |
BidirectionalIterator | simultaneous_multiple_merge (BidirectionalIterator first, BidirectionalIterator last, OccupancySpectrum const &sp, Generator &g) |
| merges randomly selected elements in a range according to an occupancy spectrum.
|
|
Generic algorithms for manipulating abstract coalescent trees.
◆ binary_merge() [1/2]
template<class BidirectionalIterator , class Generator >
BidirectionalIterator quetzal::coalescence::algorithm::binary_merge |
( |
BidirectionalIterator |
first, |
|
|
BidirectionalIterator |
last, |
|
|
Generator & |
g |
|
) |
| |
merges 2 randomly selected elements in a range, using sum operand between elements.
- Parameters
-
first | iterator at the begin of the range |
last | iterator to the past-the-end element. |
g | a random generator that must meet the requirements of UniformRandomBitGenerator concept. |
- Returns
- An iterator to the element that follows the last element of the nodes remaining after coalescence. The function cannot alter the properties of the object containing the range of elements (i.e., it cannot alter the size of an array or a container): signaling the new size of the shortened range is done by returning an iterator to the element that should be considered its new past-the-end element. The range between first and this iterator includes all the remaining nodes in the sequence.
◆ binary_merge() [2/2]
template<class BidirectionalIterator , class T , class BinaryOperation , class Generator >
BidirectionalIterator quetzal::coalescence::algorithm::binary_merge |
( |
BidirectionalIterator |
first, |
|
|
BidirectionalIterator |
last, |
|
|
T |
init, |
|
|
BinaryOperation |
op, |
|
|
Generator & |
g |
|
) |
| |
merges 2 randomly selected elements in a range.
- Parameters
-
first | iterator at the begin of the range |
last | iterator to the past-the-end element. |
init | the value at which parent is initialized |
op | binary operation function object that will be applied for branching a child to its parent. The binary operator takes the parent value a (initialized to init) and the value of the child b. The signature of the function should be equivalent to the following: Ret fun(const Type1 &parent, const Type2 &child); |
g | a random generator that must meet the requirements of UniformRandomBitGenerator concept. |
- Returns
- An iterator to the element that follows the last element of the nodes remaining after coalescence. The function cannot alter the properties of the object containing the range of elements (i.e., it cannot alter the size of an array or a container): signaling the new size of the shortened range is done by returning an iterator to the element that should be considered its new past-the-end element. The range between first and this iterator includes all the remaining nodes in the sequence.
◆ simultaneous_multiple_merge() [1/2]
template<class BidirectionalIterator , class OccupancySpectrum , class Generator >
BidirectionalIterator quetzal::coalescence::algorithm::simultaneous_multiple_merge |
( |
BidirectionalIterator |
first, |
|
|
BidirectionalIterator |
last, |
|
|
OccupancySpectrum const & |
sp, |
|
|
Generator & |
g |
|
) |
| |
merges randomly selected elements in a range according to an occupancy spectrum.
- Parameters
-
first | iterator at the begin of the range |
last | iterator to the past-the-end element. |
sp | occupancy spectrum giving the merging configuration |
g | a random generator that must meet the requirements of UniformRandomBitGenerator concept. |
- Returns
- An iterator to the element that follows the last element of the nodes remaining after coalescence. The function cannot alter the properties of the object containing the range of elements (i.e., it cannot alter the size of an array or a container): signaling the new size of the shortened range is done by returning an iterator to the element that should be considered its new past-the-end element. The range between first and this iterator includes all the remaining nodes in the sequence.
◆ simultaneous_multiple_merge() [2/2]
template<class BidirectionalIterator , class T , class BinaryOperation , class OccupancySpectrum , class Generator >
BidirectionalIterator quetzal::coalescence::algorithm::simultaneous_multiple_merge |
( |
BidirectionalIterator |
first, |
|
|
BidirectionalIterator |
last, |
|
|
T |
init, |
|
|
OccupancySpectrum const & |
sp, |
|
|
BinaryOperation |
op, |
|
|
Generator & |
g |
|
) |
| |
merges randomly selected elements in a range according to an occupancy spectrum.
- Parameters
-
first | iterator at the begin of the range |
last | iterator to the past-the-end element. |
init | the value at which parent is initialized |
sp | occupancy spectrum giving the merging configuration |
op | binary operation function object that will be applied for branching a child to its parent. The binary operator takes the parent value a (initialized to init) and the value of the child b. The signature of the function should be equivalent to the following: Ret fun(const Type1 &parent, const Type2 &child); |
g | a random generator that must meet the requirements of UniformRandomBitGenerator concept. |
- Returns
- An iterator to the element that follows the last element of the nodes remaining after coalescence. The function cannot alter the properties of the object containing the range of elements (i.e., it cannot alter the size of an array or a container): signaling the new size of the shortened range is done by returning an iterator to the element that should be considered its new past-the-end element. The range between first and this iterator includes all the remaining nodes in the sequence.