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

Wrapper to std::normal_distribution to facilitate sampling multiple values, sampling with a given seed and computing the PDF value at a specific point. More...

#include <normal_dist.h>

Public Types

using result_type = RealType
 The return type every time we call pdf, sample.

Public Member Functions

 NormalDist ()
 Constructor.
 NormalDist (result_type mu, result_type std=1.0)
 Constructor.
result_type pdf (result_type x) const
 compute the value of the PDF at the given point
result_type sample () const
 Sample from the distribution.
result_type sample (uint_t seed) const
 Sample from the distribution.
std::vector< result_type > sample_many (uint_t size) const
 sample from the distribution
std::vector< result_type > sample_many (uint_t size, uint_t seed) const
 sample from the distribution
result_type mean () const
 The mean value of the distribution.
result_type std () const
 The STD of the distribution.

Detailed Description

template<typename RealType = real_t>
class bitsim::maths::stats::NormalDist< RealType >

Wrapper to std::normal_distribution to facilitate sampling multiple values, sampling with a given seed and computing the PDF value at a specific point.

Member Typedef Documentation

◆ result_type

template<typename RealType = real_t>
using bitsim::maths::stats::NormalDist< RealType >::result_type = RealType

The return type every time we call pdf, sample.

Constructor & Destructor Documentation

◆ NormalDist() [1/2]

template<typename RealType>
bitsim::maths::stats::NormalDist< RealType >::NormalDist ( )

Constructor.

◆ NormalDist() [2/2]

template<typename RealType>
bitsim::maths::stats::NormalDist< RealType >::NormalDist ( result_type mu,
result_type std = 1.0 )
explicit

Constructor.

Member Function Documentation

◆ mean()

template<typename RealType = real_t>
result_type bitsim::maths::stats::NormalDist< RealType >::mean ( ) const
inline

The mean value of the distribution.

◆ pdf()

template<typename RealType>
RealType bitsim::maths::stats::NormalDist< RealType >::pdf ( result_type x) const

compute the value of the PDF at the given point

◆ sample() [1/2]

template<typename RealType>
RealType bitsim::maths::stats::NormalDist< RealType >::sample ( ) const

Sample from the distribution.

◆ sample() [2/2]

template<typename RealType>
RealType bitsim::maths::stats::NormalDist< RealType >::sample ( uint_t seed) const

Sample from the distribution.

◆ sample_many() [1/2]

template<typename RealType>
std::vector< RealType > bitsim::maths::stats::NormalDist< RealType >::sample_many ( uint_t size) const

sample from the distribution

◆ sample_many() [2/2]

template<typename RealType>
std::vector< RealType > bitsim::maths::stats::NormalDist< RealType >::sample_many ( uint_t size,
uint_t seed ) const

sample from the distribution

◆ std()

template<typename RealType = real_t>
result_type bitsim::maths::stats::NormalDist< RealType >::std ( ) const
inline

The STD of the distribution.


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