![]() |
Quetzal-CoaTL
The Coalescence Template Library
|
#include <quetzal/coalescence/merger_policy.hpp>
Discrete generation simultaneous multiple merger.
Defines a policy class to coalesce multiple nodes selected uniformely at random in a range, according to an OccupancySpectrum. Its interface makes it exchangeable with the BinaryMerger policy.
SpectrumSamplingPolicy | The policy used to generate an OccupancySpectrum: on_the_fly or in_memoized_distribution |
Static Public Member Functions | |
template<class BidirectionalIterator , class T , class BinaryOperation , class Generator > | |
static auto | merge (BidirectionalIterator first, BidirectionalIterator last, unsigned int N, T const &init, BinaryOperation const &op, Generator &g) |
merges multiple randomly selected elements in a range. | |
template<class BidirectionalIterator , class Generator > | |
static auto | merge (BidirectionalIterator first, BidirectionalIterator last, unsigned int N, Generator &g) |
merges multiple randomly selected elements in a range. | |
|
inlinestatic |
merges multiple randomly selected elements in a range.
Coalesce multiple nodes selected uniformely at random in a range, according to an OccupancySpectrum.
first | iterator at the begin of the range |
last | iterator to the past-the-end element. |
N | the number of individuals in the population |
T
BidirectionalIterator::value_type
must be defined.T
default constructor is used to set the value at which the parent is initialized.a
and b
two objects of type T
, the expression a + b
must be defined.
|
inlinestatic |
merges multiple randomly selected elements in a range.
@detais Coalesce multiple nodes selected uniformely at random in a range, according to an OccupancySpectrum.
first | iterator at the begin of the range |
last | iterator to the past-the-end element. |
N | the number of individuals in the population |
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 as parameters the parent value (initialized to init) and the value of the child. The signature of the function should be equivalent to the following: Ret fun(const Type1 &parent, const Type2 &child); |