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

The exponential distribution for MPFR (the log method). More...

#include <RandomLib/MPFRExponentialL.hpp>

Public Member Functions

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

Detailed Description

The exponential distribution for MPFR (the log method).

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

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

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

Definition at line 42 of file MPFRExponentialL.hpp.

Constructor & Destructor Documentation

RandomLib::MPFRExponentialL::MPFRExponentialL ( )
inline

Initialize the MPFRExponentialL object.

Definition at line 51 of file MPFRExponentialL.hpp.

RandomLib::MPFRExponentialL::~MPFRExponentialL ( )
inline

Destroy the MPFRExponentialL object.

Definition at line 60 of file MPFRExponentialL.hpp.

Member Function Documentation

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

Sample from the exponential distribution with mean 1.

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

Definition at line 75 of file MPFRExponentialL.hpp.


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