bpp-core3  3.0.0
bpp::Uniform01QD Class Reference

A quick and dirty uniform random number generator. More...

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

+ Inheritance diagram for bpp::Uniform01QD:
+ Collaboration diagram for bpp::Uniform01QD:

Public Member Functions

 Uniform01QD (long seed)
 Create a Random Number Generator. More...
 
virtual ~Uniform01QD ()
 Destroy the generator. More...
 
void setSeed (long seed)
 Set the seed for a new set of random numbers. More...
 
double drawNumber () const
 Get a random number between 0.0 and 1.0 (exclusive of the end point values). More...
 

Private Attributes

long seed_
 

Detailed Description

A quick and dirty uniform random number generator.

This is a congruential uniform generator which draw double between 0 and 1 excluding the end points.

WARNING!!! Only works on 32bits architectures!

Definition at line 57 of file Uniform01QD.h.

Constructor & Destructor Documentation

◆ Uniform01QD()

bpp::Uniform01QD::Uniform01QD ( long  seed)
inline

Create a Random Number Generator.

Parameters
seedThe seed for the random numbers.

Definition at line 66 of file Uniform01QD.h.

◆ ~Uniform01QD()

virtual bpp::Uniform01QD::~Uniform01QD ( )
inlinevirtual

Destroy the generator.

Definition at line 71 of file Uniform01QD.h.

Member Function Documentation

◆ drawNumber()

double Uniform01QD::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 Uniform01QD.cpp.

◆ setSeed()

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

Set the seed for a new set of random numbers.

Implements bpp::RandomFactory.

Definition at line 77 of file Uniform01QD.h.

References seed_.

Member Data Documentation

◆ seed_

long bpp::Uniform01QD::seed_
mutableprivate

Definition at line 85 of file Uniform01QD.h.

Referenced by setSeed().


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