Virtual Belgium  2.0
A micro-simulation platform for the Belgian population
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros Pages
Ranfib Struct Reference

Fast and good random number generator (see Numerical Recipes). More...

#include <Random.hpp>

Public Member Functions

 Ranfib (unsigned long j)
 Constructor. More...
 
double doub ()
 Returns random double-precision floating point value in [0,1]. More...
 
float fl ()
 Returns random simple-precision floating point value in [0,1]. More...
 

Public Attributes

double dtab [55]
 part of the generator state More...
 
double dd
 part of the generator state More...
 
int inext
 part of the generator state More...
 
int inextp
 part of the generator state More...
 

Detailed Description

Fast and good random number generator (see Numerical Recipes).

Implements Knuth's substractive generator using only floating operations.

Constructor & Destructor Documentation

Ranfib::Ranfib ( unsigned long  j)
inline

Constructor.

Parameters
jany integer seed.

Member Function Documentation

double Ranfib::doub ( )
inline

Returns random double-precision floating point value in [0,1].

Returns
a random number
float Ranfib::fl ( )
inline

Returns random simple-precision floating point value in [0,1].

Returns
a random number

Member Data Documentation

double Ranfib::dd

part of the generator state

double Ranfib::dtab[55]

part of the generator state

int Ranfib::inext

part of the generator state

int Ranfib::inextp

part of the generator state


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