public class XoRoShiRo64StarStar extends IntProvider
float
values try the
XoRoShiRo64Star
generator.
This is a member of the Xor-Shift-Rotate family of generators. Memory footprint is 64 bits.
Modifier and Type | Field and Description |
---|---|
protected int |
state0
State 0 of the generator.
|
protected int |
state1
State 1 of the generator.
|
Constructor and Description |
---|
XoRoShiRo64StarStar(int[] seed)
Creates a new instance.
|
XoRoShiRo64StarStar(int seed0,
int seed1)
Creates a new instance using a 2 element seed.
|
Modifier and Type | Method and 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 . |
nextBoolean, nextBytes, nextBytes, nextDouble, nextInt, nextLong, resetCachedState
checkIndex, checkStateSize, composeStateInternal, extendSeed, extendSeed, fillState, fillState, restoreState, saveState, splitStateInternal, toString
protected int state0
protected int state1
public XoRoShiRo64StarStar(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 XoRoShiRo64StarStar(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–2022 The Apache Software Foundation. All rights reserved.