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, nextLong
checkIndex, checkStateSize, fillState, fillState, nextInt, nextLong, restoreState, saveState
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 RandomLongSource
next
in class LongProvider
public String toString()
toString
in class BaseProvider
public static int numberOfSubcycleGenerators()
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)
Copyright © 2016 The Apache Software Foundation. All rights reserved.