|
|
auto | size () const |
| | Number of data points.
|
| |
|
bool | empty () const |
| | True if no data points.
|
| |
|
size_t | getLastIndex () const |
| | index of last get() or addGroup() element
|
| |
|
void | clear () |
| | Clear all data.
|
| |
| template<typename Iterator > |
| void | setWeight (Iterator begin, Iterator end) |
| | Set weights for all data points in vec More...
|
| |
| void | push_back (const T &value, double weight=1.0) |
| | Add data and it's weight. More...
|
| |
| template<typename RandomGenerator > |
| const T & | sample (RandomGenerator &engine) |
| | Get random data point respecting the weighted distribution. More...
|
| |
template<typename T>
class Faunus::WeightedDistribution< T >
Stores a series of elements with given weight.
Elements is accessed with get() that will randomly pick from the weighted distribution. Add elements with addGroup() where the default weight is unity.
- Template Parameters
-