Rand48

#include <Imath/ImathRandom.h>

The Rand48 class is a fast pseudo-random number generator based on the C Standard Library functions erand48(), nrand48() & company. It generates a uniformly distributed sequence.

class Rand48

Random-number generator based on the C Standard Library functions erand48(), nrand48() & company; generates a uniformly distributed sequence.

Public Functions

inline Rand48(unsigned long int seed = 0)

Constructor.

inline void init(unsigned long int seed)

Re-initialize with a given seed.

inline bool nextb()

Get the next value in the sequence (range: [false, true])

inline long int nexti()

Get the next value in the sequence (range: [0 … 0x7fffffff])

inline double nextf()

Get the next value in the sequence (range: [0 … 1[)

inline double nextf(double rangeMin, double rangeMax)

Get the next value in the sequence (range [rangeMin … rangeMax[)