Implementation detail for a random_intersperse range adaptor object.
More...
#include <random_intersperse.hpp>
|
template<class Fn , class URNG = typename ranges::detail::default_random_engine> |
constexpr auto | operator() (Fn fn, double probability=kDefaultProbability, URNG &engine=ranges::detail::get_random_engine()) const |
| Overload that returns a view closure to compose with other views. More...
|
|
template<class Range , class Fn , class URNG > |
constexpr auto | operator() (Range &&range, Fn fn, double probability, std::reference_wrapper< URNG > engine) const |
| Overload that unwraps the engine reference from a view closure. More...
|
|
template<class Range , class Fn , class URNG = typename ranges::detail::default_random_engine> |
constexpr auto | operator() (Range &&range, Fn fn, double probability=kDefaultProbability, URNG &engine=ranges::detail::get_random_engine()) const |
| Overload that implements the andom_intersperse algorithm. More...
|
|
Implementation detail for a random_intersperse range adaptor object.
Definition at line 123 of file random_intersperse.hpp.
◆ operator()() [1/3]
template<class Fn , class URNG = typename ranges::detail::default_random_engine>
constexpr auto beluga::views::detail::random_intersperse_fn::operator() |
( |
Fn |
fn, |
|
|
double |
probability = kDefaultProbability , |
|
|
URNG & |
engine = ranges::detail::get_random_engine() |
|
) |
| const |
|
inlineconstexpr |
Overload that returns a view closure to compose with other views.
- Template Parameters
-
Fn | A callable type which takes no arguments and returns values to be inserted. |
URNG | A random number generator that satisfies the UniformRandomBitGenerator requirements. |
- Parameters
-
fn | Fn instance used to insert values between source elements. |
probability | The probability of inserting a value on each iteration. |
engine | The random number generator object. |
Definition at line 176 of file random_intersperse.hpp.
◆ operator()() [2/3]
template<class Range , class Fn , class URNG >
constexpr auto beluga::views::detail::random_intersperse_fn::operator() |
( |
Range && |
range, |
|
|
Fn |
fn, |
|
|
double |
probability, |
|
|
std::reference_wrapper< URNG > |
engine |
|
) |
| const |
|
inlineconstexpr |
◆ operator()() [3/3]
template<class Range , class Fn , class URNG = typename ranges::detail::default_random_engine>
constexpr auto beluga::views::detail::random_intersperse_fn::operator() |
( |
Range && |
range, |
|
|
Fn |
fn, |
|
|
double |
probability = kDefaultProbability , |
|
|
URNG & |
engine = ranges::detail::get_random_engine() |
|
) |
| const |
|
inlineconstexpr |
Overload that implements the andom_intersperse algorithm.
- Template Parameters
-
Range | A forward range. |
Fn | A callable type which takes no arguments or a distribution type that takes a URNG. |
URNG | A random number generator that satisfies the UniformRandomBitGenerator requirements. |
- Parameters
-
range | The range to be adapted. |
fn | Fn instance used to insert values between source elements. |
probability | The probability of inserting a value on each iteration. |
engine | The random number generator object. |
Definition at line 140 of file random_intersperse.hpp.
◆ kDefaultProbability
constexpr double beluga::views::detail::random_intersperse_fn::kDefaultProbability = 0.5 |
|
staticconstexpr |
The documentation for this struct was generated from the following file: