RandomIntSource
, RestorableUniformRandomProvider
, UniformRandomProvider
public class XoRoShiRo64Star extends IntProvider
float
generation. This is slightly faster than the
all-purpose generator XoRoShiRo64StarStar
.
This is a member of the Xor-Shift-Rotate family of generators. Memory footprint is 64 bits.
Modifier and Type | Field | Description |
---|---|---|
protected int |
state0 |
State 0 of the generator.
|
protected int |
state1 |
State 1 of the generator.
|
Constructor | Description |
---|---|
XoRoShiRo64Star(int[] seed) |
Creates a new instance.
|
XoRoShiRo64Star(int seed0,
int seed1) |
Creates a new instance using a 2 element seed.
|
Modifier and Type | Method | Description |
---|---|---|
protected byte[] |
getStateInternal() |
Creates a snapshot of the RNG state.
|
int |
next() |
|
protected int |
nextOutput() |
Use the current state to compute the next output from the generator.
|
protected void |
setStateInternal(byte[] s) |
Resets the RNG to the given
state . |
checkIndex, checkStateSize, composeStateInternal, fillState, fillState, nextInt, nextLong, restoreState, saveState, splitStateInternal, toString
nextBoolean, nextBytes, nextBytes, nextDouble, nextFloat, nextInt, nextLong, resetCachedState
protected int state0
protected int state1
public XoRoShiRo64Star(int[] seed)
seed
- Initial seed.
If the length is larger than 2, only the first 2 elements will
be used; if smaller, the remaining elements will be automatically
set. A seed containing all zeros will create a non-functional generator.public XoRoShiRo64Star(int seed0, int seed1)
seed0
- Initial seed element 0.seed1
- Initial seed element 1.protected int nextOutput()
next()
before the current state is updated.protected byte[] getStateInternal()
getStateInternal
in class IntProvider
protected void setStateInternal(byte[] s)
state
.setStateInternal
in class IntProvider
s
- State (previously obtained by a call to
BaseProvider.getStateInternal()
).BaseProvider.checkStateSize(byte[],int)
public int next()
Copyright © 2016–2019 The Apache Software Foundation. All rights reserved.