|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.fasteasytrade.JRandTest.Algo.Cipher com.fasteasytrade.JRandTest.Algo.MT19937Prng
MT19937Prng class java implements MT19937 prng.
Translated from C to java.
A C-program for MT19937, with initialization improved 2002/1/26. Coded by Takuji Nishimura and Makoto Matsumoto. Before using, initialize the state by using init_genrand(seed) or init_by_array(init_key, key_length). Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura, All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The names of its contributors may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Any feedback is very welcome. http://www.math.sci.hiroshima-u.ac.jp/˜m-mat/MT19937Prng/emt.html email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space)
Field Summary | |
(package private) long |
LOWER_MASK
|
(package private) int |
M
|
(package private) long[] |
mag01
|
(package private) long |
MATRIX_A
|
(package private) long[] |
mt
|
(package private) int |
mti
|
(package private) int |
N
|
(package private) long |
UPPER_MASK
|
Constructor Summary | |
MT19937Prng()
|
Method Summary | |
(package private) long |
genrand_int31()
generates a random number on [0,0x7fffffff]-interval |
(package private) long |
genrand_int32()
generates a random number on [0,0xffffffff]-interval |
(package private) double |
genrand_real1()
generates a random number on [0,1]-real-interval These real versions are due to Isaku Wada, 2002/01/09 added |
(package private) double |
genrand_real2()
generates a random number on [0,1)-real-interval These real versions are due to Isaku Wada, 2002/01/09 added |
(package private) double |
genrand_real3()
generates a random number on (0,1)-real-interval These real versions are due to Isaku Wada, 2002/01/09 added |
(package private) double |
genrand_res53()
generates a random number on [0,1) with 53-bit resolution These real versions are due to Isaku Wada, 2002/01/09 added |
(package private) void |
init_by_array(long[] init_key,
int key_length)
initialize by an array with array-length slight change for C++, 2004/2/26 |
(package private) void |
init_genrand(long s)
initializes mt[N] with a seed |
static void |
main(String[] args)
Test MT19937Prng PRNG |
Methods inherited from class com.fasteasytrade.JRandTest.Algo.Cipher |
compareBytes |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
final int N
final int M
final long MATRIX_A
final long UPPER_MASK
final long LOWER_MASK
long[] mt
int mti
long[] mag01
Constructor Detail |
public MT19937Prng()
Method Detail |
void init_genrand(long s)
void init_by_array(long[] init_key, int key_length)
slight change for C++, 2004/2/26
init_key
- is the array for initializing keyskey_length
- is its lengthlong genrand_int32()
long genrand_int31()
double genrand_real1()
These real versions are due to Isaku Wada, 2002/01/09 added
double genrand_real2()
These real versions are due to Isaku Wada, 2002/01/09 added
double genrand_real3()
These real versions are due to Isaku Wada, 2002/01/09 added
double genrand_res53()
These real versions are due to Isaku Wada, 2002/01/09 added
public static void main(String[] args)
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |