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 and 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 and 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 . |
nextBoolean, nextInt, nextLong, resetCachedState
checkIndex, checkStateSize, composeStateInternal, extendSeed, extendSeed, fillState, fillState, restoreState, saveState, splitStateInternal, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
jumps, jumps
doubles, doubles, doubles, doubles, ints, ints, ints, ints, longs, longs, longs, longs, nextBoolean, nextBytes, nextBytes, nextDouble, nextDouble, nextDouble, nextFloat, nextFloat, nextFloat, nextInt, nextInt, nextInt, nextLong, 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–2022 The Apache Software Foundation. All rights reserved.