Skip to content

baaraan::truncated_normal_distribution

Module: Univariate Random Distributions

This class describes a truncated normal distribution. More...

#include <truncated_normal_distribution.h>

Public Classes

Name
class param_type

Public Types

Name
typedef RealType result_type

Public Functions

Name
truncated_normal_distribution(result_type mean =0, result_type stddev =1, result_type lower =-4, result_type upper =4)
Constructs a Truncated Normal Distribution by accpting its underlying parameters.
truncated_normal_distribution(const param_type & p)
Constructs a Truncated Normal Distribution by accpting an instance of truncated_normal_distribution::param_type.
void reset()
template <class URNG >
result_type
operator()(URNG & g)
template <class URNG >
result_type
operator()(URNG & g, const param_type & p)
result_type mean() const
result_type stddev() const
param_type param() const
void param(const param_type & p)
result_type min() const
result_type max() const
template <class URNG >
RealType
operator()(URNG & g, const param_type & parm)

Friends

Name
bool operator==(const truncated_normal_distribution & x, const truncated_normal_distribution & y)
bool operator!=(const truncated_normal_distribution & x, const truncated_normal_distribution & y)
std::basic_ostream< _CharT, _Traits > & operator<<(std::basic_ostream< _CharT, _Traits > & os, const truncated_normal_distribution< _RT > & x)
std::basic_istream< _CharT, _Traits > & operator>>(std::basic_istream< _CharT, _Traits > & is, truncated_normal_distribution< _RT > & x)

Detailed Description

template <class RealType  =double>
class baaraan::truncated_normal_distribution;

This class describes a truncated normal distribution.

Template Parameters:

  • RealType Indicates the type of return values

Public Types Documentation

typedef result_type

typedef RealType baaraan::truncated_normal_distribution< RealType >::result_type;

Public Functions Documentation

function truncated_normal_distribution

inline explicit truncated_normal_distribution(
    result_type mean =0,
    result_type stddev =1,
    result_type lower =-4,
    result_type upper =4
)

Constructs a Truncated Normal Distribution by accpting its underlying parameters.

Parameters:

  • mean The mean value
  • stddev The standard deviation value
  • lower The lower truncation bound
  • upper The upper truncation bound

function truncated_normal_distribution

inline explicit truncated_normal_distribution(
    const param_type & p
)

Constructs a Truncated Normal Distribution by accpting an instance of truncated_normal_distribution::param_type.

Parameters:

  • p

function reset

inline void reset()

function operator()

template <class URNG >
inline result_type operator()(
    URNG & g
)

function operator()

template <class URNG >
result_type operator()(
    URNG & g,
    const param_type & p
)

function mean

inline result_type mean() const

function stddev

inline result_type stddev() const

function param

inline param_type param() const

function param

inline void param(
    const param_type & p
)

function min

inline result_type min() const

function max

inline result_type max() const

function operator()

template <class URNG >
RealType operator()(
    URNG & g,
    const param_type & parm
)

Friends

friend operator==

friend bool operator==(
    const truncated_normal_distribution & x,

    const truncated_normal_distribution & y
);

friend operator!=

friend bool operator!=(
    const truncated_normal_distribution & x,

    const truncated_normal_distribution & y
);

friend operator<<

friend std::basic_ostream< _CharT, _Traits > & operator<<(
    std::basic_ostream< _CharT, _Traits > & os,

    const truncated_normal_distribution< _RT > & x
);

friend operator>>

friend std::basic_istream< _CharT, _Traits > & operator>>(
    std::basic_istream< _CharT, _Traits > & is,

    truncated_normal_distribution< _RT > & x
);

Updated on 2 June 2021 at 11:24:45 CEST