|
rippled
|
Invocable that returns random samples from a range according to a discrete distribution. More...

Public Member Functions | |
| Selector (RAIter first, RAIter last, std::vector< double > const &w, Generator &g) | |
| Constructor. More... | |
| std::iterator_traits< RAIter >::value_type | operator() () |
Private Attributes | |
| RAIter | first_ |
| RAIter | last_ |
| std::discrete_distribution | dd_ |
| Generator | g_ |
Invocable that returns random samples from a range according to a discrete distribution.
Given a pair of random access iterators begin and end, each call to the instance of Selector returns a random entry in the range (begin,end) according to the weights provided at construction.
Definition at line 81 of file test/csf/random.h.
| ripple::test::csf::Selector< RAIter, Generator >::Selector | ( | RAIter | first, |
| RAIter | last, | ||
| std::vector< double > const & | w, | ||
| Generator & | g | ||
| ) |
Constructor.
| first | Random access iterator to the start of the range |
| last | Random access iterator to the end of the range |
| w | Vector of weights of size list-first |
| g | the pseudo-random number generator |
Definition at line 94 of file test/csf/random.h.
| std::iterator_traits<RAIter>::value_type ripple::test::csf::Selector< RAIter, Generator >::operator() | ( | ) |
Definition at line 109 of file test/csf/random.h.
|
private |
Definition at line 83 of file test/csf/random.h.
|
private |
Definition at line 83 of file test/csf/random.h.
|
private |
Definition at line 84 of file test/csf/random.h.
|
private |
Definition at line 85 of file test/csf/random.h.
1.8.17