Awali
Another Weighted Automata library
Public Member Functions
awali::sttc::internal::random_selector< RandomGenerator > Struct Template Reference

#include <random.hh>

Public Member Functions

 random_selector (const RandomGenerator &g=RandomGenerator())
 
template<typename Container >
auto operator() (const Container &c) -> decltype(*std::begin(c))
 A randomly selected member of c. More...
 
template<typename Iter >
Iter operator() (Iter start, Iter end)
 A randomly selected iterator in [start, end). More...
 
template<typename Container >
auto pop (Container &c) -> typename Container::value_type
 A randomly selected member of c. Remove it from c. More...
 
template<typename Iter >
Iter select (Iter start, Iter end)
 A randomly selected iterator in [start, end). More...
 

Constructor & Destructor Documentation

◆ random_selector()

template<typename RandomGenerator = std::default_random_engine>
awali::sttc::internal::random_selector< RandomGenerator >::random_selector ( const RandomGenerator &  g = RandomGenerator())

Member Function Documentation

◆ operator()() [1/2]

template<typename RandomGenerator = std::default_random_engine>
template<typename Container >
auto awali::sttc::internal::random_selector< RandomGenerator >::operator() ( const Container &  c) -> decltype(*std::begin(c))

A randomly selected member of c.

◆ operator()() [2/2]

template<typename RandomGenerator = std::default_random_engine>
template<typename Iter >
Iter awali::sttc::internal::random_selector< RandomGenerator >::operator() ( Iter  start,
Iter  end 
)

A randomly selected iterator in [start, end).

◆ pop()

template<typename RandomGenerator = std::default_random_engine>
template<typename Container >
auto awali::sttc::internal::random_selector< RandomGenerator >::pop ( Container &  c) -> typename Container::value_type

A randomly selected member of c. Remove it from c.

◆ select()

template<typename RandomGenerator = std::default_random_engine>
template<typename Iter >
Iter awali::sttc::internal::random_selector< RandomGenerator >::select ( Iter  start,
Iter  end 
)

A randomly selected iterator in [start, end).


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