Public Member Functions | Static Public Attributes | List of all members
beluga::views::detail::random_intersperse_fn Struct Reference

Implementation detail for a random_intersperse range adaptor object. More...

#include <random_intersperse.hpp>

Public Member Functions

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...
 

Static Public Attributes

static constexpr double kDefaultProbability = 0.5
 Default insertion probability on each iteration. More...
 

Detailed Description

Implementation detail for a random_intersperse range adaptor object.

Definition at line 123 of file random_intersperse.hpp.

Member Function Documentation

◆ 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
FnA callable type which takes no arguments and returns values to be inserted.
URNGA random number generator that satisfies the UniformRandomBitGenerator requirements.
Parameters
fnFn instance used to insert values between source elements.
probabilityThe probability of inserting a value on each iteration.
engineThe 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

Overload that unwraps the engine reference from a view closure.

Definition at line 161 of file random_intersperse.hpp.

◆ 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
RangeA forward range.
FnA callable type which takes no arguments or a distribution type that takes a URNG.
URNGA random number generator that satisfies the UniformRandomBitGenerator requirements.
Parameters
rangeThe range to be adapted.
fnFn instance used to insert values between source elements.
probabilityThe probability of inserting a value on each iteration.
engineThe random number generator object.

Definition at line 140 of file random_intersperse.hpp.

Member Data Documentation

◆ kDefaultProbability

constexpr double beluga::views::detail::random_intersperse_fn::kDefaultProbability = 0.5
staticconstexpr

Default insertion probability on each iteration.

Definition at line 125 of file random_intersperse.hpp.


The documentation for this struct was generated from the following file:


beluga
Author(s):
autogenerated on Tue Jul 16 2024 02:59:54