bpp-core3  3.0.0
bpp::Uniform01WH Class Reference

A uniform random number generator. More...

#include <Bpp/Numeric/Random/Uniform01WH.h>

+ Inheritance diagram for bpp::Uniform01WH:
+ Collaboration diagram for bpp::Uniform01WH:

Public Member Functions

 Uniform01WH (long seed)
 Create a Random Number Generator. More...
 
virtual ~Uniform01WH ()
 Destroy the generator. More...
 
void setSeed (long seed)
 Set the seed for a new set of random numbers. More...
 
void setSeeds (long seed1, long seed2=20356, long seed3=35412)
 Set the three seeds. More...
 
double drawNumber () const
 Get a random number between 0.0 and 1.0 (exclusive of the end point values). More...
 

Private Attributes

long ix
 
long iy
 
long iz
 

Detailed Description

A uniform random number generator.

This is a congruential uniform generator which draw double between 0 and 1 excluding the end points. This generator is based on a Fortan routine from Wichmann, B. A. and Hill, I. D. (1982). "An efficient and portable pseudorandom number generator," Applied Statistics, 31, 188-190

Definition at line 57 of file Uniform01WH.h.

Constructor & Destructor Documentation

◆ Uniform01WH()

bpp::Uniform01WH::Uniform01WH ( long  seed)
inline

Create a Random Number Generator.

Parameters
seedThe seed for the random numbers.

Definition at line 66 of file Uniform01WH.h.

◆ ~Uniform01WH()

virtual bpp::Uniform01WH::~Uniform01WH ( )
virtual

Destroy the generator.

Member Function Documentation

◆ drawNumber()

double Uniform01WH::drawNumber ( ) const
virtual

Get a random number between 0.0 and 1.0 (exclusive of the end point values).

Implements bpp::RandomFactory.

Definition at line 50 of file Uniform01WH.cpp.

◆ setSeed()

void bpp::Uniform01WH::setSeed ( long  seed)
inlinevirtual

Set the seed for a new set of random numbers.

Implements bpp::RandomFactory.

Definition at line 77 of file Uniform01WH.h.

References setSeeds().

◆ setSeeds()

void bpp::Uniform01WH::setSeeds ( long  seed1,
long  seed2 = 20356,
long  seed3 = 35412 
)
inline

Set the three seeds.

Definition at line 82 of file Uniform01WH.h.

References ix, iy, and iz.

Referenced by setSeed().

Member Data Documentation

◆ ix

long bpp::Uniform01WH::ix
mutableprivate

Definition at line 93 of file Uniform01WH.h.

Referenced by setSeeds().

◆ iy

long bpp::Uniform01WH::iy
private

Definition at line 93 of file Uniform01WH.h.

Referenced by setSeeds().

◆ iz

long bpp::Uniform01WH::iz
private

Definition at line 93 of file Uniform01WH.h.

Referenced by setSeeds().


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