|
Infinity Engine v0.6.20
C++ API Documentation
|
Parameter set for the distribution. More...
#include <PRNGDistribution.hpp>
Public Types | |
| using | distribution_type = DiscreteDistribution< IntType > |
Public Member Functions | |
| param_type () | |
| Default constructor. Creates uniform distribution over {0}. | |
| template<typename InputIterator > | |
| param_type (InputIterator first, InputIterator last) | |
| Constructs from iterator range of weights. | |
| param_type (std::initializer_list< double > wl) | |
| Constructs from initializer list of weights. | |
| template<typename UnaryOperation > | |
| param_type (size_t count, double xmin, double xmax, UnaryOperation fw) | |
| Constructs from function evaluated at intervals. | |
| std::vector< double > | probabilities () const |
| Returns the probability vector. | |
Public Attributes | |
| std::vector< double > | m_prob |
| Individual probabilities. | |
| std::vector< double > | m_cp |
| Cumulative probabilities for efficient sampling. | |
Friends | |
| class | DiscreteDistribution< IntType > |
| bool | operator== (const param_type &lhs, const param_type &rhs) |
| bool | operator!= (const param_type &lhs, const param_type &rhs) |
Parameter set for the distribution.
Stores the probability mass function as both raw probabilities and cumulative probabilities for efficient sampling.
| using Infinity::Engine::DiscreteDistribution< IntType >::param_type::distribution_type = DiscreteDistribution<IntType> |
|
inline |
Default constructor. Creates uniform distribution over {0}.
|
inline |
Constructs from iterator range of weights.
Weights will be normalized to probabilities automatically.
| InputIterator | Iterator type for weights |
| first | Iterator to first weight |
| last | Iterator past last weight |
|
inline |
Constructs from initializer list of weights.
Weights will be normalized to probabilities automatically.
| wl | Initializer list of weights |
|
inline |
Constructs from function evaluated at intervals.
Evaluates the weight function at the midpoint of each interval [xmin + i*delta, xmin + (i+1)*delta) for i = 0..count-1.
| UnaryOperation | Function type: double -> double |
| count | Number of discrete outcomes |
| xmin | Minimum x value for function evaluation |
| xmax | Maximum x value for function evaluation |
| fw | Function to evaluate at interval midpoints |
|
inline |
Returns the probability vector.
|
friend |
|
friend |
|
friend |
| std::vector<double> Infinity::Engine::DiscreteDistribution< IntType >::param_type::m_cp |
Cumulative probabilities for efficient sampling.
| std::vector<double> Infinity::Engine::DiscreteDistribution< IntType >::param_type::m_prob |
Individual probabilities.