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

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

#include <random.hh>

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

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

Definition at line 29 of file random.hh.

Member Function Documentation

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.

References vcsn::discrete_chooser< RandomGenerator >::select().

Here is the call graph for this function:

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

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

Definition at line 50 of file random.hh.

Referenced by vcsn::discrete_chooser< RandomGenerator >::select().


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