bitsim
Model, simulate, estimate and control robots in C++
Loading...
Searching...
No Matches
bitsim::maths::stats::UniformWeightedDist< OutType, WeightType > Class Template Reference

#include <uniform_distribution.h>

Public Types

using out_type = OutType
using weights_type = std::vector<WeightType>

Public Member 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.
std::vector< real_t > probabilities () const

Member Typedef Documentation

◆ out_type

template<typename OutType, typename WeightType = real_t>
using bitsim::maths::stats::UniformWeightedDist< OutType, WeightType >::out_type = OutType

◆ weights_type

template<typename OutType, typename WeightType = real_t>
using bitsim::maths::stats::UniformWeightedDist< OutType, WeightType >::weights_type = std::vector<WeightType>

Constructor & Destructor Documentation

◆ UniformWeightedDist() [1/2]

template<typename OutType, typename WeightType>
template<typename VectorType>
bitsim::maths::stats::UniformWeightedDist< OutType, WeightType >::UniformWeightedDist ( const VectorType & weights)

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

◆ UniformWeightedDist() [2/2]

template<typename OutType, typename WeightType>
bitsim::maths::stats::UniformWeightedDist< OutType, WeightType >::UniformWeightedDist ( std::initializer_list< WeightType > weights)

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

Member Function Documentation

◆ probabilities()

template<typename OutType, typename WeightType = real_t>
std::vector< real_t > bitsim::maths::stats::UniformWeightedDist< OutType, WeightType >::probabilities ( ) const
inline

returns the [a, b] range

◆ sample() [1/2]

template<typename OutType, typename WeightType>
UniformWeightedDist< OutType, WeightType >::out_type bitsim::maths::stats::UniformWeightedDist< OutType, WeightType >::sample ( )

Get a sample.

◆ sample() [2/2]

template<typename OutType, typename WeightType>
UniformWeightedDist< OutType, WeightType >::out_type bitsim::maths::stats::UniformWeightedDist< OutType, WeightType >::sample ( uint_t seed)

Get a sample.


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