HE_Mesh
6.0.1
|
Public Member Functions | |
Object | clone () throws CloneNotSupportedException |
boolean | stateEquals (final Object o) |
void | readState (final DataInputStream stream) throws IOException |
void | writeState (final DataOutputStream stream) throws IOException |
WB_MTRandom () | |
WB_MTRandom (final long seed) | |
synchronized void | setSeed (final long seed) |
synchronized void | reset () |
final int | nextInt () |
final short | nextShort () |
final char | nextChar () |
final boolean | nextBoolean () |
final boolean | nextBoolean (final float probability) |
final boolean | nextBoolean (final double probability) |
final byte | nextByte () |
final void | nextBytes (final byte[] bytes) |
final long | nextLong () |
final long | nextLong (final long n) |
final double | nextDouble () |
final double | nextCenteredDouble () |
final double | nextGaussian () |
final float | nextFloat () |
final float | nextCenteredFloat () |
final int | nextInt (final int n) |
Private Attributes | |
int | mt [] |
int | mti |
int | mag01 [] |
double | __nextNextGaussian |
boolean | __haveNextNextGaussian |
long | seed |
Static Private Attributes | |
static final long | serialVersionUID = 3636987267914792302L |
static final int | N = 624 |
static final int | M = 397 |
static final int | MATRIX_A = 0x9908b0df |
static final int | UPPER_MASK = 0x80000000 |
static final int | LOWER_MASK = 0x7fffffff |
static final int | TEMPERING_MASK_B = 0x9d2c5680 |
static final int | TEMPERING_MASK_C = 0xefc60000 |
wblut.math.WB_MTRandom.WB_MTRandom | ( | ) |
Constructor using the default seed.
wblut.math.WB_MTRandom.WB_MTRandom | ( | final long | seed | ) |
Constructor using a given seed. Though you pass this seed in as a long, it's best to make sure it's actually an integer.
seed | the seed |
References wblut.math.WB_MTRandom.setSeed().
Object wblut.math.WB_MTRandom.clone | ( | ) | throws CloneNotSupportedException |
final boolean wblut.math.WB_MTRandom.nextBoolean | ( | ) |
Next boolean.
References wblut.math.WB_MTRandom.LOWER_MASK, wblut.math.WB_MTRandom.M, wblut.math.WB_MTRandom.mag01, wblut.math.WB_MTRandom.mt, wblut.math.WB_MTRandom.N, wblut.math.WB_MTRandom.TEMPERING_MASK_B, and wblut.math.WB_MTRandom.TEMPERING_MASK_C.
final boolean wblut.math.WB_MTRandom.nextBoolean | ( | final float | probability | ) |
This generates a coin flip with a probability probability
of returning true, else returning false. probability
must be between 0.0 and 1.0, inclusive. Not as precise a random real event as nextBoolean(double), but twice as fast. To explicitly use this, remember you may need to cast to float first.
probability | the probability |
References wblut.math.WB_MTRandom.LOWER_MASK, wblut.math.WB_MTRandom.M, wblut.math.WB_MTRandom.mag01, wblut.math.WB_MTRandom.mt, wblut.math.WB_MTRandom.N, wblut.math.WB_MTRandom.TEMPERING_MASK_B, and wblut.math.WB_MTRandom.TEMPERING_MASK_C.
final boolean wblut.math.WB_MTRandom.nextBoolean | ( | final double | probability | ) |
This generates a coin flip with a probability probability
of returning true, else returning false. probability
must be between 0.0 and 1.0, inclusive.
probability | the probability |
References wblut.math.WB_MTRandom.LOWER_MASK, wblut.math.WB_MTRandom.M, wblut.math.WB_MTRandom.mag01, wblut.math.WB_MTRandom.mt, wblut.math.WB_MTRandom.N, wblut.math.WB_MTRandom.TEMPERING_MASK_B, and wblut.math.WB_MTRandom.TEMPERING_MASK_C.
final byte wblut.math.WB_MTRandom.nextByte | ( | ) |
Next byte.
References wblut.math.WB_MTRandom.LOWER_MASK, wblut.math.WB_MTRandom.M, wblut.math.WB_MTRandom.mag01, wblut.math.WB_MTRandom.mt, wblut.math.WB_MTRandom.N, wblut.math.WB_MTRandom.TEMPERING_MASK_B, and wblut.math.WB_MTRandom.TEMPERING_MASK_C.
final void wblut.math.WB_MTRandom.nextBytes | ( | final byte[] | bytes | ) |
Fill array of bytes with random values.
bytes | the bytes |
References wblut.math.WB_MTRandom.LOWER_MASK, wblut.math.WB_MTRandom.M, wblut.math.WB_MTRandom.mag01, wblut.math.WB_MTRandom.mt, wblut.math.WB_MTRandom.N, wblut.math.WB_MTRandom.TEMPERING_MASK_B, and wblut.math.WB_MTRandom.TEMPERING_MASK_C.
final double wblut.math.WB_MTRandom.nextCenteredDouble | ( | ) |
Returns a random double in the half-open range from [-0.5,0.5). Thus -0.5 is a valid result but 0.5 is not.
References wblut.math.WB_MTRandom.nextDouble().
final float wblut.math.WB_MTRandom.nextCenteredFloat | ( | ) |
Returns a random float in the half-open range from [-0.5,0.5). Thus -0.5 is a valid result but 0.5 is not.
References wblut.math.WB_MTRandom.nextFloat().
final char wblut.math.WB_MTRandom.nextChar | ( | ) |
Next char.
References wblut.math.WB_MTRandom.LOWER_MASK, wblut.math.WB_MTRandom.M, wblut.math.WB_MTRandom.mag01, wblut.math.WB_MTRandom.mt, wblut.math.WB_MTRandom.N, wblut.math.WB_MTRandom.TEMPERING_MASK_B, and wblut.math.WB_MTRandom.TEMPERING_MASK_C.
final double wblut.math.WB_MTRandom.nextDouble | ( | ) |
Returns a random double in the half-open range from [0.0,1.0). Thus 0.0 is a valid result but 1.0 is not.
References wblut.math.WB_MTRandom.LOWER_MASK, wblut.math.WB_MTRandom.M, wblut.math.WB_MTRandom.mag01, wblut.math.WB_MTRandom.mt, wblut.math.WB_MTRandom.N, wblut.math.WB_MTRandom.TEMPERING_MASK_B, and wblut.math.WB_MTRandom.TEMPERING_MASK_C.
final float wblut.math.WB_MTRandom.nextFloat | ( | ) |
Returns a random float in the half-open range from [0.0f,1.0f). Thus 0.0f is a valid result but 1.0f is not.
References wblut.math.WB_MTRandom.LOWER_MASK, wblut.math.WB_MTRandom.M, wblut.math.WB_MTRandom.mag01, wblut.math.WB_MTRandom.mt, wblut.math.WB_MTRandom.N, wblut.math.WB_MTRandom.TEMPERING_MASK_B, and wblut.math.WB_MTRandom.TEMPERING_MASK_C.
final double wblut.math.WB_MTRandom.nextGaussian | ( | ) |
Next gaussian.
References wblut.math.WB_MTRandom.__nextNextGaussian, wblut.math.WB_MTRandom.LOWER_MASK, wblut.math.WB_MTRandom.M, wblut.math.WB_MTRandom.mag01, wblut.math.WB_MTRandom.mt, wblut.math.WB_MTRandom.N, wblut.math.WB_MTRandom.TEMPERING_MASK_B, and wblut.math.WB_MTRandom.TEMPERING_MASK_C.
final int wblut.math.WB_MTRandom.nextInt | ( | ) |
Next int.
References wblut.math.WB_MTRandom.LOWER_MASK, wblut.math.WB_MTRandom.M, wblut.math.WB_MTRandom.mag01, wblut.math.WB_MTRandom.mt, wblut.math.WB_MTRandom.N, wblut.math.WB_MTRandom.TEMPERING_MASK_B, and wblut.math.WB_MTRandom.TEMPERING_MASK_C.
final int wblut.math.WB_MTRandom.nextInt | ( | final int | n | ) |
Returns an integer drawn uniformly from 0 to n-1. Suffice it to say, n must be > 0, or an IllegalArgumentException is raised.
n | the n |
References wblut.math.WB_MTRandom.LOWER_MASK, wblut.math.WB_MTRandom.M, wblut.math.WB_MTRandom.mag01, wblut.math.WB_MTRandom.mt, wblut.math.WB_MTRandom.N, wblut.math.WB_MTRandom.TEMPERING_MASK_B, and wblut.math.WB_MTRandom.TEMPERING_MASK_C.
final long wblut.math.WB_MTRandom.nextLong | ( | ) |
Next long.
References wblut.math.WB_MTRandom.LOWER_MASK, wblut.math.WB_MTRandom.M, wblut.math.WB_MTRandom.mag01, wblut.math.WB_MTRandom.mt, wblut.math.WB_MTRandom.N, wblut.math.WB_MTRandom.TEMPERING_MASK_B, and wblut.math.WB_MTRandom.TEMPERING_MASK_C.
final long wblut.math.WB_MTRandom.nextLong | ( | final long | n | ) |
Returns a long drawn uniformly from 0 to n-1. Suffice it to say, n must be > 0, or an IllegalArgumentException is raised.
n | the n |
References wblut.math.WB_MTRandom.LOWER_MASK, wblut.math.WB_MTRandom.M, wblut.math.WB_MTRandom.mag01, wblut.math.WB_MTRandom.mt, wblut.math.WB_MTRandom.N, wblut.math.WB_MTRandom.TEMPERING_MASK_B, and wblut.math.WB_MTRandom.TEMPERING_MASK_C.
final short wblut.math.WB_MTRandom.nextShort | ( | ) |
Next short.
References wblut.math.WB_MTRandom.LOWER_MASK, wblut.math.WB_MTRandom.M, wblut.math.WB_MTRandom.mag01, wblut.math.WB_MTRandom.mt, wblut.math.WB_MTRandom.N, wblut.math.WB_MTRandom.TEMPERING_MASK_B, and wblut.math.WB_MTRandom.TEMPERING_MASK_C.
void wblut.math.WB_MTRandom.readState | ( | final DataInputStream | stream | ) | throws IOException |
Reads the entire state of the MersenneTwister RNG from the stream.
stream | the stream |
IOException | Signals that an I/O exception has occurred. |
synchronized void wblut.math.WB_MTRandom.reset | ( | ) |
References wblut.math.WB_MTRandom.setSeed().
synchronized void wblut.math.WB_MTRandom.setSeed | ( | final long | seed | ) |
Initalize the pseudo random number generator. Don't pass in a long that's bigger than an int (Mersenne Twister only uses the first 32 bits for its seed).
seed | the new seed |
References wblut.math.WB_MTRandom.MATRIX_A, wblut.math.WB_MTRandom.mti, wblut.math.WB_MTRandom.N, and wblut.math.WB_MTRandom.seed.
boolean wblut.math.WB_MTRandom.stateEquals | ( | final Object | o | ) |
void wblut.math.WB_MTRandom.writeState | ( | final DataOutputStream | stream | ) | throws IOException |
Writes the entire state of the MersenneTwister RNG to the stream.
stream | the stream |
IOException | Signals that an I/O exception has occurred. |
|
private |
|
private |
|
staticprivate |
|
staticprivate |
|
private |
|
staticprivate |
|
private |
|
private |
|
staticprivate |
|
private |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |