|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.math.random.AbstractRandomGenerator
jp.ac.hiroshima_u.sci.math.saito.tinymt.TinyMT64
public final class TinyMT64
TinyMT64 is a pseudo random number generator.
To get an instance, call getDefault(long)
.
This class is not synchronized, One way to use TinyMT64 in concurrent environment is to use an instance per a thread.
This class supports jump function.
User can get an array of pseudo random number generators by calling
getDefaultArray(int, long, long)
,
or getDefaultArray(int, String, long)
.
This class supports discrete characteristic polynomial generators.
User can get an array of pseudo random number generators whose characteristic
polynomials are discrete by calling
getTinyMTArray(int, long)
.
Method Summary | |
---|---|
static TinyMT64 |
getDefault()
Factory method which returns the TinyMT with the first generated parameter of TinyMTDC. |
static TinyMT64 |
getDefault(int[] seeds)
get default TinyMT32 with seeding by array. |
static TinyMT64 |
getDefault(long seed)
Factory method which returns the TinyMT with the first generated parameter of TinyMTDC. |
static TinyMT64 |
getDefault(java.lang.String seed)
Factory method which returns the TinyMT with the first generated parameter of TinyMTDC. |
static TinyMT64[] |
getDefaultArray(int count,
long seed,
long jump)
make and return an array of TinyMT. |
static TinyMT64[] |
getDefaultArray(int count,
java.lang.String seed,
long jump)
Make and return an array of TinyMT. |
int |
getDelta()
return Delta of TinyMT. |
int |
getId()
return ID of TinyMT. |
TinyMT64[] |
getJumpedArray(int count,
long jump)
Make and return an array of TinyMT. |
static TinyMT64[] |
getTinyMTArray(int count,
long seed)
Make and return an array of TinyMT. |
int |
getWeight()
return Hamming weight of characteristic polynomial of TinyMT. |
double |
nextDouble()
returns double r, 0 <= r < 1.0. |
float |
nextFloat()
returns float r, 0 <= r < 1.0. |
int |
nextInt()
returns 32-bit integer. |
long |
nextLong()
returns 64-bit integer. |
void |
setSeed(int[] seeds)
initialize internal state. |
void |
setSeed(long seed)
initialize internal state. |
void |
setSeed(long[] seeds)
Seeding by array of long. |
void |
setSeed(java.lang.String seed)
seeding by string, This will be convenient. |
Methods inherited from class org.apache.commons.math.random.AbstractRandomGenerator |
---|
clear, nextBoolean, nextBytes, nextGaussian, nextInt, setSeed |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public int nextInt()
nextInt
in interface org.apache.commons.math.random.RandomGenerator
nextInt
in class org.apache.commons.math.random.AbstractRandomGenerator
public long nextLong()
nextLong
in interface org.apache.commons.math.random.RandomGenerator
nextLong
in class org.apache.commons.math.random.AbstractRandomGenerator
public void setSeed(java.lang.String seed)
seed
- seed of pseudo random numberspublic void setSeed(long[] seeds)
seeds
- seeds of pseudo random numbers.public void setSeed(int[] seeds)
setSeed
in interface org.apache.commons.math.random.RandomGenerator
setSeed
in class org.apache.commons.math.random.AbstractRandomGenerator
seeds
- seeds of randomnesspublic void setSeed(long seed)
setSeed
in interface org.apache.commons.math.random.RandomGenerator
setSeed
in class org.apache.commons.math.random.AbstractRandomGenerator
seed
- seeds of randomnesspublic static TinyMT64 getDefault(java.lang.String seed)
seed
- seed of pseudo random numbers.
public static TinyMT64 getDefault(long seed)
seed
- seed of pseudo random numbers.
public static TinyMT64 getDefault(int[] seeds)
seeds
- seeds for initialization.
public static TinyMT64 getDefault()
System.nanoTime()
and Thread.getId()
are used
for seed.
public static TinyMT64[] getDefaultArray(int count, long seed, long jump)
count
- number of TinyMT to be created.seed
- seed of first elementjump
- step is jump * 264
public static TinyMT64[] getDefaultArray(int count, java.lang.String seed, long jump)
count
- number of TinyMT to be created.seed
- seed of first elementjump
- step is jump * 264
public TinyMT64[] getJumpedArray(int count, long jump)
count
- number of arraysjump
- jump step
public static TinyMT64[] getTinyMTArray(int count, long seed) throws java.io.IOException
getJumpedArray(int, long)
using each element and can get more TinyMTs.
count
- number of TinyMT to be created.seed
- seed of each element
java.io.IOException
- when can't read resource file.public double nextDouble()
nextDouble
in interface org.apache.commons.math.random.RandomGenerator
nextDouble
in class org.apache.commons.math.random.AbstractRandomGenerator
public float nextFloat()
nextFloat
in interface org.apache.commons.math.random.RandomGenerator
nextFloat
in class org.apache.commons.math.random.AbstractRandomGenerator
public int getId()
public int getDelta()
public int getWeight()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |