ExRandom  3.0
exrandom::discrete_normal_dist< digit_gen >::param_type Struct Reference

Hold the parameters of discrete_normal_dist. More...

#include <exrandom/discrete_normal_dist.hpp>

Inheritance diagram for exrandom::discrete_normal_dist< digit_gen >::param_type:
exrandom::discrete_normal_distribution::param_type

Public Member Functions

 param_type (int mu_num, int mu_den, int sigma_num, int sigma_den)
 
 param_type ()
 
 param_type (int mu, int sigma)
 
 param_type (int mu_num, int sigma_num, int den)
 
int mu_num () const
 
int mu_den () const
 
int sigma_num () const
 
int sigma_den () const
 

Friends

bool operator== (const param_type &p1, const param_type &p2)
 
std::ostream & operator<< (std::ostream &os, const param_type &x)
 
std::istream & operator>> (std::istream &is, param_type &x)
 

Detailed Description

template<typename digit_gen>
struct exrandom::discrete_normal_dist< digit_gen >::param_type

Hold the parameters of discrete_normal_dist.

Definition at line 45 of file discrete_normal_dist.hpp.

Constructor & Destructor Documentation

◆ param_type() [1/4]

template<typename digit_gen>
exrandom::discrete_normal_dist< digit_gen >::param_type::param_type ( int  mu_num,
int  mu_den,
int  sigma_num,
int  sigma_den 
)
inlineexplicit

Construct from the individual parameters.

Parameters
mu_numthe numerator of μ.
mu_denthe denominator of μ.
sigma_numthe numerator of σ.
sigma_denthe denominator of σ.

Sets μ = mu_num / mu_den and σ = sigma_num / sigma_den.

Definition at line 57 of file discrete_normal_dist.hpp.

◆ param_type() [2/4]

template<typename digit_gen>
exrandom::discrete_normal_dist< digit_gen >::param_type::param_type ( )
inlineexplicit

The default constructor.

Sets μ = 0 and σ = 1.

Definition at line 66 of file discrete_normal_dist.hpp.

◆ param_type() [3/4]

template<typename digit_gen>
exrandom::discrete_normal_dist< digit_gen >::param_type::param_type ( int  mu,
int  sigma 
)
inlineexplicit

Construct with integer parameters.

Parameters
muthe value of μ.
sigmathe value of σ.

Sets μ = mu and σ = sigma.

Definition at line 77 of file discrete_normal_dist.hpp.

◆ param_type() [4/4]

template<typename digit_gen>
exrandom::discrete_normal_dist< digit_gen >::param_type::param_type ( int  mu_num,
int  sigma_num,
int  den 
)
inline

Construct with parameters with a common denominator.

Parameters
mu_numthe numerator of μ.
sigma_numthe numerator of σ.
denthe common denominator.

Sets μ = mu_num / den and σ = sigma_num / den.

Definition at line 89 of file discrete_normal_dist.hpp.

Member Function Documentation

◆ mu_num()

template<typename digit_gen>
int exrandom::discrete_normal_dist< digit_gen >::param_type::mu_num ( ) const
inline
Returns
the numerator of μ.

Definition at line 95 of file discrete_normal_dist.hpp.

◆ mu_den()

template<typename digit_gen>
int exrandom::discrete_normal_dist< digit_gen >::param_type::mu_den ( ) const
inline
Returns
the denominator of μ.

Definition at line 99 of file discrete_normal_dist.hpp.

◆ sigma_num()

template<typename digit_gen>
int exrandom::discrete_normal_dist< digit_gen >::param_type::sigma_num ( ) const
inline
Returns
the numerator of σ.

Definition at line 103 of file discrete_normal_dist.hpp.

◆ sigma_den()

template<typename digit_gen>
int exrandom::discrete_normal_dist< digit_gen >::param_type::sigma_den ( ) const
inline
Returns
the denominator of σ.

Definition at line 107 of file discrete_normal_dist.hpp.

Friends And Related Function Documentation

◆ operator==

template<typename digit_gen>
bool operator== ( const param_type p1,
const param_type p2 
)
friend

Test for equality.

Parameters
p1
p2
Returns
p1 == p2.

Definition at line 117 of file discrete_normal_dist.hpp.

◆ operator<<

template<typename digit_gen>
std::ostream& operator<< ( std::ostream &  os,
const param_type x 
)
friend

Inserts a param_type x into the output stream os.

Parameters
osan output stream..
xa param_type.
Returns
os.

Definition at line 132 of file discrete_normal_dist.hpp.

◆ operator>>

template<typename digit_gen>
std::istream& operator>> ( std::istream &  is,
param_type x 
)
friend

Extracts a param_type x from the input stream is.

Parameters
isan input stream.
xa param_type.
Returns
is.

Definition at line 148 of file discrete_normal_dist.hpp.


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