Vcsn  2.8
Be Rational
vcsn::discrete_chooser< RandomGenerator > Struct Template Reference

Random selector on container, using discrete distribution. More...

#include <random.hh>

Inheritance diagram for vcsn::discrete_chooser< RandomGenerator >:
Collaboration diagram for vcsn::discrete_chooser< RandomGenerator >:

Public Member Functions

 discrete_chooser (RandomGenerator &g)
 
template<typename Container_w , typename Container >
Container::iterator select (Container_w weight, Container cont) const
 
template<typename Container_w , typename Container >
Container::iterator operator() (Container_w weight, Container cont) const
 

Private Attributes

RandomGenerator & gen_
 

Detailed Description

template<typename RandomGenerator>
struct vcsn::discrete_chooser< RandomGenerator >

Random selector on container, using discrete distribution.

Definition at line 27 of file random.hh.

Constructor & Destructor Documentation

◆ discrete_chooser()

template<typename RandomGenerator>
vcsn::discrete_chooser< RandomGenerator >::discrete_chooser ( RandomGenerator &  g)
inline

Definition at line 29 of file random.hh.

Member Function Documentation

◆ operator()()

template<typename RandomGenerator>
template<typename Container_w , typename Container >
Container::iterator vcsn::discrete_chooser< RandomGenerator >::operator() ( Container_w  weight,
Container  cont 
) const
inline

Definition at line 44 of file random.hh.

◆ select()

template<typename RandomGenerator>
template<typename Container_w , typename Container >
Container::iterator vcsn::discrete_chooser< RandomGenerator >::select ( Container_w  weight,
Container  cont 
) const
inline

Member Data Documentation

◆ gen_

template<typename RandomGenerator>
RandomGenerator& vcsn::discrete_chooser< RandomGenerator >::gen_
private

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