DUNE: Uniform Navigational Environment  2016.05.0
DUNE::Math::Random::FSR256 Class Reference

Detailed Description

Feedback shift register generator with 256-byte table.

This has the same behavior as GLIBC2's random() with default settings.

Public Member Functions

 FSR256 (void)
 
 FSR256 (int32_t seed)
 
 ~FSR256 ()
 
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::FSR256::FSR256 ( void  )
DUNE::Math::Random::FSR256::FSR256 ( int32_t  seed)

References seed().

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

Member Function Documentation

int32_t DUNE::Math::Random::FSR256::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 i, j, and table.

Referenced by seed().

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

Re-initialize generator with given seed.

Parameters
valuevalue for seed.

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

References i, random(), and table.

Referenced by FSR256().

Member Data Documentation

int DUNE::Math::Random::FSR256::i

Referenced by random(), and seed().

int DUNE::Math::Random::FSR256::j

Referenced by random().

int32_t DUNE::Math::Random::FSR256::table[c_table_size]

Referenced by random(), and seed().

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