GeoGen API Reference
Classes | Typedefs | Functions
geogen::random Namespace Reference

Contains pseudo-random number generation features. More...

Classes

class  RandomSequence
 Pseudo-random sequence of number determined by its seed. More...
 
class  RandomSequence2D
 Pseudo-random sequence which generates a number for each point in 2D space in each step of the sequence. The numbers are determined by the initial seed. This sequence has to be advanced manually. More...
 

Typedefs

typedef unsigned RandomSeed
 Numeric pseudo-random generator seed.
 

Functions

unsigned Hash (unsigned x)
 Calculates a hash of x. More...
 
unsigned Hash (unsigned a, unsigned b)
 Calculates a hash of a and b. More...
 
unsigned Hash (unsigned a, unsigned b, unsigned c)
 Calculates a hash of a, b and c. More...
 
unsigned Hash (unsigned a, unsigned b, unsigned c, unsigned d)
 Calculates a hash of a, b, c and d. More...
 
unsigned Hash (unsigned a, unsigned b, unsigned c, unsigned d, unsigned e)
 Calculates a hash of a, b, c, d and e. More...
 
unsigned Hash (String str)
 Calculates a hash of str. More...
 
RandomSeed CreateSeed (unsigned n)
 Creates a random seed from a number. More...
 
RandomSeed CreateSeed (int n)
 Creates a random seed from a number. More...
 
RandomSeed CreateSeed (unsigned long long n)
 Creates a random seed from a number. More...
 
RandomSeed CreateSeed (long long n)
 Creates a random seed from a number. More...
 
RandomSeed CreateSeed (double n)
 Creates a random seed from a number. More...
 
RandomSeed CreateSeed (String str)
 Creates a random seed from a string, using a hash function. More...
 
RandomSeed RecognizeSeed (String str)
 Creates a random seed from a string, attempting to read it as a number first and if it fails, it uses a hash function. More...
 
RandomSeed CombineSeeds (RandomSeed s1, RandomSeed s2)
 Combine two random seeds into one, deterministically. More...
 
RandomSeed CombineSeeds (RandomSeed s1, RandomSeed s2, RandomSeed s3)
 Combine three random seeds into one, deterministically. More...
 
RandomSeed CombineSeeds (RandomSeed s1, RandomSeed s2, RandomSeed s3, RandomSeed s4)
 Combine four random seeds into one, deterministically. More...
 
RandomSeed CombineSeeds (RandomSeed s1, RandomSeed s2, RandomSeed s3, RandomSeed s4, RandomSeed s5)
 Combine five random seeds into one, deterministically. More...
 

Detailed Description

Contains pseudo-random number generation features.

Function Documentation

RandomSeed geogen::random::CombineSeeds ( RandomSeed  s1,
RandomSeed  s2 
)

Combine two random seeds into one, deterministically.

Parameters
s1The first seed.
s2The second seed.
Returns
The combined.
RandomSeed geogen::random::CombineSeeds ( RandomSeed  s1,
RandomSeed  s2,
RandomSeed  s3 
)

Combine three random seeds into one, deterministically.

Parameters
s1The first seed.
s2The second seed.
s3The third seed.
Returns
The combined.
RandomSeed geogen::random::CombineSeeds ( RandomSeed  s1,
RandomSeed  s2,
RandomSeed  s3,
RandomSeed  s4 
)

Combine four random seeds into one, deterministically.

Parameters
s1The first seed.
s2The second seed.
s3The third seed.
s4The fourth seed.
Returns
The combined.
RandomSeed geogen::random::CombineSeeds ( RandomSeed  s1,
RandomSeed  s2,
RandomSeed  s3,
RandomSeed  s4,
RandomSeed  s5 
)

Combine five random seeds into one, deterministically.

Parameters
s1The first seed.
s2The second seed.
s3The third seed.
s4The fourth seed.
s5The fourth seed.
Returns
The combined.
RandomSeed geogen::random::CreateSeed ( unsigned  n)

Creates a random seed from a number.

Parameters
nThe number.
Returns
The seed.
RandomSeed geogen::random::CreateSeed ( int  n)

Creates a random seed from a number.

Parameters
nThe number.
Returns
The seed.
RandomSeed geogen::random::CreateSeed ( unsigned long long  n)

Creates a random seed from a number.

Parameters
nThe number.
Returns
The seed.
RandomSeed geogen::random::CreateSeed ( long long  n)

Creates a random seed from a number.

Parameters
nThe number.
Returns
The seed.
RandomSeed geogen::random::CreateSeed ( double  n)

Creates a random seed from a number.

Parameters
nThe number.
Returns
The seed.
RandomSeed geogen::random::CreateSeed ( String  str)

Creates a random seed from a string, using a hash function.

Parameters
strThe string.
Returns
The seed.
unsigned geogen::random::Hash ( unsigned  x)
inline

Calculates a hash of x.

Parameters
xThe x.
Returns
The hash.
unsigned geogen::random::Hash ( unsigned  a,
unsigned  b 
)
inline

Calculates a hash of a and b.

Parameters
aThe a.
bThe b.
Returns
The hash.

141650963

unsigned geogen::random::Hash ( unsigned  a,
unsigned  b,
unsigned  c 
)
inline

Calculates a hash of a, b and c.

Parameters
aThe a.
bThe b.
cThe c.
Returns
The hash.
unsigned geogen::random::Hash ( unsigned  a,
unsigned  b,
unsigned  c,
unsigned  d 
)
inline

Calculates a hash of a, b, c and d.

Parameters
aThe a.
bThe b.
cThe c.
dThe d.
Returns
The hash.
unsigned geogen::random::Hash ( unsigned  a,
unsigned  b,
unsigned  c,
unsigned  d,
unsigned  e 
)
inline

Calculates a hash of a, b, c, d and e.

Parameters
aThe a.
bThe b.
cThe c.
dThe d.
eThe e.
Returns
The hash.
unsigned geogen::random::Hash ( String  str)
inline

Calculates a hash of str.

Parameters
strThe str.
Returns
The hash.
RandomSeed geogen::random::RecognizeSeed ( String  str)

Creates a random seed from a string, attempting to read it as a number first and if it fails, it uses a hash function.

Parameters
strThe string.
Returns
The seed.