Template Class UniformWeightedDist

Class Documentation

template<typename OutType, typename WeightType = real_t>
class UniformWeightedDist

Public Types

typedef OutType out_type
typedef std::vector<WeightType> weights_type

Public Functions

template<typename VectorType>
UniformWeightedDist(const VectorType &weights)

Initialize with a list of weights see also: https://www.cplusplus.com/reference/random/discrete_distribution/.

UniformWeightedDist(std::initializer_list<WeightType> weights)

Initialize with a list of weights see also: https://www.cplusplus.com/reference/random/discrete_distribution/.

out_type sample()

Get a sample.

out_type sample(uint_t seed)

Get a sample.

inline std::vector<real_t> probabilities() const

returns the [a, b] range