DUNE: Uniform Navigational Environment  2017.01.0
DUNE::Math::Random::DRand48 Class Reference

Detailed Description

The popular lightweight DRand48 PRNG used for instance in java.util.Random and provided by a number of SVID compatible OSes through lrand48()/drand48().

For comparison DRand48.random() provides the same number sequences as lrand48() in POSIX systems when seeding is done by srand48().

Public Member Functions

 DRand48 ()
 
 DRand48 (int32_t seed_value)
 
 ~DRand48 ()
 
int32_t random (void)
 
void seed (int32_t value)
 
- Public Member Functions inherited from DUNE::Math::Random::Generator
virtual ~Generator ()
 
virtual double uniform (void)
 
double uniform (double a, double b)
 
double gaussian (void)
 
double gaussian (double mu, double sigma)
 
void ballU (double radius, double *x, double *y)
 
void ballG (double sigma, double *x, double *y)
 

Additional Inherited Members

- Static Public Member Functions inherited from DUNE::Math::Random::Generator
static int32_t arbitrarySeed (void)
 
- Static Public Attributes inherited from DUNE::Math::Random::Generator
static const int32_t c_max_random
 

Constructor & Destructor Documentation

DUNE::Math::Random::DRand48::DRand48 ( void  )
DUNE::Math::Random::DRand48::DRand48 ( int32_t  seed_value)

References seed().

DUNE::Math::Random::DRand48::~DRand48 ( void  )

Member Function Documentation

int32_t DUNE::Math::Random::DRand48::random ( void  )
virtual

Generate a 32-bit signed integer, uniformly distributed in [0,c_max_random].

Returns
generated number.

Implements DUNE::Math::Random::Generator.

References DUNE::Math::Random::Generator::c_max_random.

void DUNE::Math::Random::DRand48::seed ( int32_t  value)
virtual

Re-initialize generator with given seed.

Parameters
valuevalue for seed.

Implements DUNE::Math::Random::Generator.

Referenced by DRand48().

Collaboration diagram for DUNE::Math::Random::DRand48:
Collaboration graph