Crystal AI
1.0.0
|
PCG (Permuted Congruential Generator) is a C# port from C the base PCG generator presented in "PCG: A Family of Simple Fast Space-Efficient Statistically Good Algorithms for Random Number Generation" by Melissa E. O'Neill. The code follows closely the one made available by O'Neill at her site: http://www.pcg-random.org/download.html To understand how exactly this generator works read this: http://www.pcg-random.org/pdf/toms-oneill-pcg-family-v1.02.pdf More...
Public Member Functions | |
virtual int | Next () |
Random integer in the interval [0, int.MaxValue]. More... | |
virtual int | Next (int maxExclusive) |
Random integer in the semi-open interval [0, maxExclusive ). More... | |
virtual int | Next (int minInclusive, int maxExclusive) |
Random integer in the interval [minInclusive , maxExclusive ). More... | |
int[] | NextInts (int count) |
Array of size count of random integers in the interval [0, int.MaxValue]. More... | |
int[] | NextInts (int count, int maxExclusive) |
Array of size count of random integers in the interval [0, maxExclusive ). More... | |
int[] | NextInts (int count, int minInclusive, int maxExclusive) |
Array of size count of random integers in the interval [minInclusive , maxExclusive ). More... | |
uint | NextUInt () |
Random unsigned integer in the interval [0, uint.MaxValue]. More... | |
uint | NextUInt (uint maxExclusive) |
Random unsigned integer in the interval [0, maxExclusive ). More... | |
uint | NextUInt (uint minInclusive, uint maxExclusive) |
Random unsigned integer in the interval [minInclusive , maxExclusive ). More... | |
uint[] | NextUInts (int count) |
Array of size count of unsigned integers in the interval [0, uint.MaxValue]. More... | |
uint[] | NextUInts (int count, uint maxExclusive) |
Array of size count of unsigned integers in the interval [0, maxExclusive ). More... | |
uint[] | NextUInts (int count, uint minInclusive, uint maxExclusive) |
Array of size count of unsigned integers in the interval [minInclusive , maxExclusive ). More... | |
virtual float | NextFloat () |
Random single precision floating point number in the interval [0,1]. More... | |
virtual float | NextFloat (float maxInclusive) |
Random single precision floating point number in the interval [0, maxInclusive ]. More... | |
virtual float | NextFloat (float minInclusive, float maxInclusive) |
Random single precision floating point number in the interval [minInclusive , maxInclusive ]. More... | |
float[] | NextFloats (int count) |
Array of size count of single precision floating point random numbers in the interval [0,1]. More... | |
float[] | NextFloats (int count, float maxInclusive) |
Array of size count of single precision floating point random numbers in the interval [0, maxInclusive ]. More... | |
float[] | NextFloats (int count, float minInclusive, float maxInclusive) |
Array of size count of single precision floating point random numbers in the interval [minInclusive , maxInclusive ]. More... | |
virtual double | NextDouble () |
Random double precision floating point number in the interval [0, 1]. More... | |
virtual double | NextDouble (double maxInclusive) |
Random double precision floating point number in the interval [0, maxInclusive ]. More... | |
virtual double | NextDouble (double minInclusive, double maxInclusive) |
Random double precision floating point number in the interval [minInclusive , maxInclusive ]. More... | |
double[] | NextDoubles (int count) |
Array of size count of double precision floating point random numbers in the interval [0, 1]. More... | |
double[] | NextDoubles (int count, double maxInclusive) |
Array of size count of double precision floating point random numbers in the interval [0, maxInclusive . More... | |
double[] | NextDoubles (int count, double minInclusive, double maxInclusive) |
Array of size count of double precision floating point random numbers in the interval [minInclusive , maxInclusive ]. More... | |
byte | NextByte () |
Random byte. More... | |
byte[] | NextBytes (int count) |
Array of size count of random bytes. More... | |
bool | NextBool () |
Random boolean. More... | |
bool[] | NextBools (int count) |
Array of size count of random booleans. More... | |
int | PeriodPow2 () |
Base 2 exponent of the period of this generator, i.e. Period of Generator = 2^PeriodPow2(). More... | |
void | SetStream (int sequence) |
Set the stream for this generator. More... | |
void | SetStream (ulong sequence) |
Set the stream for this generator. More... | |
ulong | CurrentStream () |
Query the current stream used by this generator. More... | |
Pcg () | |
Initializes a new instance of the T:Crystal.Pcg class. More... | |
Pcg (int seed) | |
Initializes a new instance of the T:Crystal.Pcg class. More... | |
Pcg (int seed, int sequence) | |
Initializes a new instance of the T:Crystal.Pcg class. More... | |
Pcg (ulong seed, ulong sequence=ShiftedIncrement) | |
Initializes a new instance of the T:Crystal.Pcg class. More... | |
Static Public Attributes | |
static Pcg | Default => _defaultInstance ?? (_defaultInstance = new Pcg(PcgSeed.GuidBasedSeed())) |
Default instance. More... | |
PCG (Permuted Congruential Generator) is a C# port from C the base PCG generator presented in "PCG: A Family of Simple Fast Space-Efficient Statistically Good Algorithms for Random Number Generation" by Melissa E. O'Neill. The code follows closely the one made available by O'Neill at her site: http://www.pcg-random.org/download.html To understand how exactly this generator works read this: http://www.pcg-random.org/pdf/toms-oneill-pcg-family-v1.02.pdf
|
inline |
Initializes a new instance of the T:Crystal.Pcg class.
|
inline |
Initializes a new instance of the T:Crystal.Pcg class.
seed | The seed. |
|
inline |
Initializes a new instance of the T:Crystal.Pcg class.
seed | The seed. |
sequence | The sequence. |
|
inline |
Initializes a new instance of the T:Crystal.Pcg class.
seed | The seed. |
sequence | The sequence. |
|
inline |
Query the current stream used by this generator.
|
inlinevirtual |
Random integer in the interval [0, int.MaxValue].
|
inlinevirtual |
Random integer in the semi-open interval [0, maxExclusive ).
maxExclusive | The maximum value; exclusive. |
T:System.ArgumentException | Max Exclusive must be positive |
|
inlinevirtual |
Random integer in the interval [minInclusive , maxExclusive ).
minInclusive | The minimum value; inclusive. |
maxExclusive | The maximum value; exclusive. |
T:System.ArgumentException | MaxExclusive must be larger than MinInclusive |
|
inline |
Random boolean.
|
inline |
Array of size count of random booleans.
count | The count. |
T:System.ArgumentException | Zero count |
|
inline |
Random byte.
|
inline |
Array of size count of random bytes.
count | The count. |
T:System.ArgumentException | Zero count |
|
inlinevirtual |
Random double precision floating point number in the interval [0, 1].
|
inlinevirtual |
Random double precision floating point number in the interval [0, maxInclusive ].
maxInclusive | The maximum inclusive. |
T:System.ArgumentException | Max must be larger than 0 |
|
inlinevirtual |
Random double precision floating point number in the interval [minInclusive , maxInclusive ].
minInclusive | The minimum inclusive. |
maxInclusive | The maximum inclusive. |
T:System.ArgumentException | Max must be larger than min |
|
inline |
Array of size count of double precision floating point random numbers in the interval [0, 1].
count | The count. |
T:System.ArgumentException | Zero count |
|
inline |
Array of size count of double precision floating point random numbers in the interval [0, maxInclusive .
count | The count. |
maxInclusive | The maximum inclusive. |
T:System.ArgumentException | Zero count |
|
inline |
Array of size count of double precision floating point random numbers in the interval [minInclusive , maxInclusive ].
count | The count. |
minInclusive | The minimum inclusive. |
maxInclusive | The maximum inclusive. |
T:System.ArgumentException | Zero count |
|
inlinevirtual |
Random single precision floating point number in the interval [0,1].
|
inlinevirtual |
Random single precision floating point number in the interval [0, maxInclusive ].
maxInclusive | The maximum inclusive. |
T:System.ArgumentException | MaxInclusive must be larger than 0 |
|
inlinevirtual |
Random single precision floating point number in the interval [minInclusive , maxInclusive ].
minInclusive | The minimum inclusive. |
maxInclusive | The maximum inclusive. |
T:System.ArgumentException | Max must be larger than min |
|
inline |
Array of size count of single precision floating point random numbers in the interval [0,1].
count | The count. |
T:System.ArgumentException | Zero count |
|
inline |
Array of size count of single precision floating point random numbers in the interval [0, maxInclusive ].
count | The count. |
maxInclusive | The maximum inclusive. |
T:System.ArgumentException | Zero count |
|
inline |
Array of size count of single precision floating point random numbers in the interval [minInclusive , maxInclusive ].
count | The count. |
minInclusive | The minimum inclusive. |
maxInclusive | The maximum inclusive. |
T:System.ArgumentException | Zero count |
|
inline |
Array of size count of random integers in the interval [0, int.MaxValue].
count | The count. |
T:System.ArgumentException | Zero count |
|
inline |
Array of size count of random integers in the interval [0, maxExclusive ).
count | The count. |
maxExclusive | The maximum value; exclusive. |
T:System.ArgumentException | Zero count |
|
inline |
Array of size count of random integers in the interval [minInclusive , maxExclusive ).
count | The count. |
minInclusive | The minimum value; inclusive. |
maxExclusive | The maximum value; exclusive. |
T:System.ArgumentException | Zero count |
|
inline |
Random unsigned integer in the interval [0, uint.MaxValue].
|
inline |
Random unsigned integer in the interval [0, maxExclusive ).
maxExclusive | The maximum value; exclusive. |
|
inline |
Random unsigned integer in the interval [minInclusive , maxExclusive ).
minInclusive | The minimum value; inclusive. |
maxExclusive | The maximum value; exclusive. |
T:System.ArgumentException |
|
inline |
Array of size count of unsigned integers in the interval [0, uint.MaxValue].
count | The count. |
T:System.ArgumentException | Zero count |
|
inline |
Array of size count of unsigned integers in the interval [0, maxExclusive ).
count | The count. |
maxExclusive | The maximum exclusive. |
T:System.ArgumentException | Zero count |
|
inline |
Array of size count of unsigned integers in the interval [minInclusive , maxExclusive ).
count | The count. |
minInclusive | The minimum inclusive. |
maxExclusive | The maximum exclusive. |
T:System.ArgumentException | Zero count |
|
inline |
Base 2 exponent of the period of this generator, i.e. Period of Generator = 2^PeriodPow2().
|
inline |
Set the stream for this generator.
sequence | The sequence. |
|
inline |
Set the stream for this generator.
sequence | The sequence. |
|
static |
Default instance.