LatNet Builder Manual  2.0.1-11
Software Package for Constructing Highly Uniform Point Sets
LatticeTester::Random Class Reference

This class generates random numbers (in fact pseudo-random numbers). More...

#include <Random.h>

Public Member Functions

 Random ()
 Constructor using a default seed for the generator. More...
 
 ~Random ()
 Destructor.
 
double randU01 ()
 Returns a random number in \([0, 1)\). More...
 
int randInt (int i, int j)
 Return a random integer in \([i, j]\). More...
 
std::uint64_t randBits (int s)
 Returns random blocks of \(s\) bits ( \(s\)-bit integers).
 
void setSeed (std::uint64_t seed)
 Sets the seed of the generator. More...
 

Detailed Description

This class generates random numbers (in fact pseudo-random numbers).

The generator used is the 64-bits generator LFSR258 from L'Ecuyer [19] with period length near \(2^{258}\) for 64-bits machines, and the 32-bits generator LFSR113 from L'Ecuyer [19] with period length near \(2^{113}\) on 32-bits machines. Thus the random numbers generated will be different on 32-bits and 64-bits machines.

Constructor & Destructor Documentation

◆ Random()

LatticeTester::Random::Random ( )

Constructor using a default seed for the generator.

One may reset the seed by calling setSeed.

Member Function Documentation

◆ randInt()

int LatticeTester::Random::randInt ( int  i,
int  j 
)

Return a random integer in \([i, j]\).

The numbers \(i\) and \(j\) can occur. Restriction: \(i < j\).

◆ randU01()

double LatticeTester::Random::randU01 ( )

Returns a random number in \([0, 1)\).

The number has 53 random bits of resolution on 64-bits machines, and 32 random bits on 32-bits machines.

◆ setSeed()

void LatticeTester::Random::setSeed ( std::uint64_t  seed)

Sets the seed of the generator.

If not called, a default seed is used.


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