RandomLib  1.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros Pages
Public Member Functions | List of all members
RandomLib::MPFRNormalR Class Reference

The normal distribution for MPFR (ratio method). More...

#include <RandomLib/MPFRNormalR.hpp>

Public Member Functions

 MPFRNormalR ()
 ~MPFRNormalR ()
int operator() (mpfr_t val, gmp_randstate_t r, mpfr_rnd_t round) const

Detailed Description

The normal distribution for MPFR (ratio method).

This class is DEPRECATED. It is included for illustrative purposes only. The MPFRNormal class provides a much more efficient method for sampling from the normal distribution.

This is an adaption of NormalDistribution to MPFR. The changes are

This class uses a mutable private object. So a single MPFRNormalR object cannot safely be used by multiple threads. In a multi-processing environment, each thread should use a thread-specific MPFRNormalR object.

Definition at line 43 of file MPFRNormalR.hpp.

Constructor & Destructor Documentation

RandomLib::MPFRNormalR::MPFRNormalR ( )

Initialize the MPFRNormalR object.

Definition at line 55 of file MPFRNormalR.hpp.

RandomLib::MPFRNormalR::~MPFRNormalR ( )

Destroy the MPFRNormalR object.

Definition at line 70 of file MPFRNormalR.hpp.

Member Function Documentation

int RandomLib::MPFRNormalR::operator() ( mpfr_t  val,
gmp_randstate_t  r,
mpfr_rnd_t  round 
) const

Sample from the normal distribution with mean 0 and variance 1.

[out]valthe sample from the normal distribution
[in,out]ra GMP random generator.
[in]roundthe rounding direction.
the MPFR ternary result (±1 if val is larger/smaller than the exact sample).

Definition at line 91 of file MPFRNormalR.hpp.

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