RandomLongSource
, JumpableUniformRandomProvider
, RestorableUniformRandomProvider
, UniformRandomProvider
XorShift1024StarPhi
public class XorShift1024Star extends LongProvider implements JumpableUniformRandomProvider
XorShift1024*
algorithm.
Note: This has been superseded by XorShift1024StarPhi
. The sequences emitted
by both generators are correlated.
Modifier | Constructor | Description |
---|---|---|
|
XorShift1024Star(long[] seed) |
Creates a new instance.
|
protected |
XorShift1024Star(long[] seed,
long multiplier) |
Creates a new instance.
|
protected |
XorShift1024Star(XorShift1024Star source) |
Creates a copy instance.
|
Modifier and Type | Method | Description |
---|---|---|
protected XorShift1024Star |
copy() |
Create a copy.
|
protected byte[] |
getStateInternal() |
Creates a snapshot of the RNG state.
|
UniformRandomProvider |
jump() |
|
long |
next() |
|
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
nextBoolean, nextBytes, nextBytes, nextDouble, nextFloat, nextInt, nextInt, nextLong, nextLong
public XorShift1024Star(long[] seed)
seed
- Initial seed.
If the length is larger than 16, only the first 16 elements will
be used; if smaller, the remaining elements will be automatically
set. A seed containing all zeros will create a non-functional generator.protected XorShift1024Star(long[] seed, long multiplier)
seed
- Initial seed.
If the length is larger than 16, only the first 16 elements will
be used; if smaller, the remaining elements will be automatically
set. A seed containing all zeros will create a non-functional generator.multiplier
- The multiplier for the XorShift1024 algorithm.protected XorShift1024Star(XorShift1024Star source)
source
- Source to copy.protected byte[] getStateInternal()
getStateInternal
in class LongProvider
protected void setStateInternal(byte[] s)
state
.setStateInternal
in class LongProvider
s
- State (previously obtained by a call to
BaseProvider.getStateInternal()
).BaseProvider.checkStateSize(byte[],int)
public long next()
next
in interface RandomLongSource
public UniformRandomProvider jump()
The jump size is the equivalent of 2512
calls to nextLong()
. It can provide
up to 2512 non-overlapping subsequences.
jump
in interface JumpableUniformRandomProvider
protected XorShift1024Star copy()
Copyright © 2016–2019 The Apache Software Foundation. All rights reserved.