RandomIntSource
, RestorableUniformRandomProvider
, UniformRandomProvider
public class MultiplyWithCarry256 extends IntProvider
Implementation is based on the (non-portable!) C code reproduced on that page.
Constructor | Description |
---|---|
MultiplyWithCarry256(int[] seed) |
Creates a new instance.
|
Modifier and Type | Method | Description |
---|---|---|
protected byte[] |
getStateInternal() |
Creates a snapshot of the RNG state.
|
int |
next() |
|
protected void |
setStateInternal(byte[] s) |
Resets the RNG to the given
state . |
checkIndex, checkStateSize, fillState, fillState, nextInt, nextLong, restoreState, saveState, toString
nextBoolean, nextBytes, nextBytes, nextDouble, nextFloat, nextInt, nextLong
public MultiplyWithCarry256(int[] seed)
seed
- Seed.
If the length is larger than 257, only the first 257 elements will
be used; if smaller, the remaining elements will be automatically
set.protected byte[] getStateInternal()
getStateInternal
in class BaseProvider
protected void setStateInternal(byte[] s)
state
.setStateInternal
in class BaseProvider
s
- State (previously obtained by a call to
BaseProvider.getStateInternal()
).BaseProvider.checkStateSize(byte[],int)
public int next()
Copyright © 2016–2018 The Apache Software Foundation. All rights reserved.