libspatialindex API Reference  (git-trunk)
rand48.cc File Reference
#include <math.h>
#include <stdlib.h>
#include <spatialindex/tools/rand48.h>
Include dependency graph for rand48.cc:

Go to the source code of this file.

Macros

#define RAND48_SEED_0   (0x330e)
 
#define RAND48_SEED_1   (0xabcd)
 
#define RAND48_SEED_2   (0x1234)
 
#define RAND48_MULT_0   (0xe66d)
 
#define RAND48_MULT_1   (0xdeec)
 
#define RAND48_MULT_2   (0x0005)
 
#define RAND48_ADD   (0x000b)
 

Functions

static void _dorand48 (unsigned short[3])
 
void srand48 (long seed) __THROW
 
unsigned short * seed48 (unsigned short xseed[3]) __THROW
 
long nrand48 (unsigned short xseed[3]) __THROW
 
long mrand48 (void) __THROW
 
long lrand48 (void) __THROW
 
void lcong48 (unsigned short p[7]) __THROW
 
long jrand48 (unsigned short xseed[3]) __THROW
 
double erand48 (unsigned short xseed[3]) __THROW
 
double drand48 (void) __THROW
 

Variables

unsigned short __rand48_Seed [3]
 
unsigned short __rand48_Mult [3]
 
unsigned short __rand48_Add = RAND48_ADD
 

Macro Definition Documentation

◆ RAND48_ADD

#define RAND48_ADD   (0x000b)

Definition at line 26 of file rand48.cc.

◆ RAND48_MULT_0

#define RAND48_MULT_0   (0xe66d)

Definition at line 23 of file rand48.cc.

◆ RAND48_MULT_1

#define RAND48_MULT_1   (0xdeec)

Definition at line 24 of file rand48.cc.

◆ RAND48_MULT_2

#define RAND48_MULT_2   (0x0005)

Definition at line 25 of file rand48.cc.

◆ RAND48_SEED_0

#define RAND48_SEED_0   (0x330e)

Definition at line 20 of file rand48.cc.

◆ RAND48_SEED_1

#define RAND48_SEED_1   (0xabcd)

Definition at line 21 of file rand48.cc.

◆ RAND48_SEED_2

#define RAND48_SEED_2   (0x1234)

Definition at line 22 of file rand48.cc.

Function Documentation

◆ _dorand48()

static void _dorand48 ( unsigned short  xseed[3])
static

Definition at line 47 of file rand48.cc.

References __rand48_Add, and __rand48_Mult.

Referenced by erand48(), jrand48(), lrand48(), mrand48(), and nrand48().

Here is the caller graph for this function:

◆ drand48()

double drand48 ( void  )

Definition at line 145 of file rand48.cc.

References __rand48_Seed, and erand48().

Referenced by SpatialIndex::StorageManager::RandomEvictionsBuffer::removeEntry().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ erand48()

double erand48 ( unsigned short  xseed[3])

Definition at line 136 of file rand48.cc.

References _dorand48().

Referenced by drand48(), and Tools::Random::nextUniformDouble().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ jrand48()

long jrand48 ( unsigned short  xseed[3])

Definition at line 129 of file rand48.cc.

References _dorand48().

Referenced by Tools::Random::nextUniformLong().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lcong48()

void lcong48 ( unsigned short  p[7])

Definition at line 118 of file rand48.cc.

References __rand48_Add, __rand48_Mult, and __rand48_Seed.

◆ lrand48()

long lrand48 ( void  )

Definition at line 111 of file rand48.cc.

References __rand48_Seed, and _dorand48().

Here is the call graph for this function:

◆ mrand48()

long mrand48 ( void  )

Definition at line 104 of file rand48.cc.

References __rand48_Seed, and _dorand48().

Here is the call graph for this function:

◆ nrand48()

long nrand48 ( unsigned short  xseed[3])

Definition at line 98 of file rand48.cc.

References _dorand48().

Here is the call graph for this function:

◆ seed48()

unsigned short* seed48 ( unsigned short  xseed[3])

◆ srand48()

void srand48 ( long  seed)

Variable Documentation

◆ __rand48_Add

unsigned short __rand48_Add = RAND48_ADD

Definition at line 43 of file rand48.cc.

Referenced by _dorand48(), lcong48(), seed48(), and srand48().

◆ __rand48_Mult

unsigned short __rand48_Mult[3]
Initial value:
= {
}
#define RAND48_MULT_2
Definition: rand48.cc:25
#define RAND48_MULT_0
Definition: rand48.cc:23
#define RAND48_MULT_1
Definition: rand48.cc:24

Definition at line 38 of file rand48.cc.

Referenced by _dorand48(), lcong48(), seed48(), and srand48().

◆ __rand48_Seed

unsigned short __rand48_Seed[3]
Initial value:
= {
}
#define RAND48_SEED_0
Definition: rand48.cc:20
#define RAND48_SEED_2
Definition: rand48.cc:22
#define RAND48_SEED_1
Definition: rand48.cc:21

Definition at line 33 of file rand48.cc.

Referenced by drand48(), lcong48(), lrand48(), mrand48(), seed48(), and srand48().