public class TwoCmres extends LongProvider
It is one of the many generators described by the author in the following article series:
| Constructor and Description |
|---|
TwoCmres(Integer seed)
Creates a new instance.
|
TwoCmres(Integer seed,
int i,
int j)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
protected byte[] |
getStateInternal()
Creates a snapshot of the RNG state.
|
long |
next() |
static int |
numberOfSubcycleGenerators() |
protected void |
setStateInternal(byte[] s)
Resets the RNG to the given
state. |
String |
toString() |
nextBoolean, nextBytes, nextBytes, nextDouble, nextFloat, nextInt, nextLongcheckIndex, checkStateSize, fillState, fillState, nextInt, nextLong, restoreState, saveStatepublic TwoCmres(Integer seed)
seed - Seed.public TwoCmres(Integer seed, int i, int j)
seed - Seed.i - Table entry for first subcycle generator.j - Table entry for second subcycle generator.IllegalArgumentException - if i == j.IndexOutOfBoundsException - if i < 0 or
i >= numberOfSubcycleGenerators().IndexOutOfBoundsException - if j < 0 or
j >= numberOfSubcycleGenerators().public long next()
next in interface RandomLongSourcenext in class LongProviderpublic String toString()
toString in class BaseProviderpublic static int numberOfSubcycleGenerators()
protected byte[] getStateInternal()
getStateInternal in class BaseProviderprotected void setStateInternal(byte[] s)
state.setStateInternal in class BaseProviders - State (previously obtained by a call to
BaseProvider.getStateInternal()).BaseProvider.checkStateSize(byte[],int)Copyright © 2016 The Apache Software Foundation. All rights reserved.