Class RanMT
- java.lang.Object
-
- edu.cornell.lassp.houle.RngPack.RandomElement
-
- edu.cornell.lassp.houle.RngPack.RandomSeedable
-
- edu.cornell.lassp.houle.RngPack.RanMT
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable
public class RanMT extends RandomSeedable implements java.io.Serializable
Mersenne Twister -- advanced psuedorandom generator with a period of 219937-1Source code is available.
This class is derived from Sean Luke's implementation
License
Copyright (c) 2003 by Paul Houle.
Derived from a work copyright (c) 2003 by Sean Luke.
Portions copyright (c) 1993 by Michael Lecuyer.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- 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.
- Neither the name of the copyright owners, their employers, nor the names of its contributors may 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 OWNERS 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.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description RanMT()RanMT(java.util.Date d)RanMT(int[] array)If a 32 bit seed isn't enough for you, you can pass an array of 624 integers.RanMT(long seed)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description doubleraw()The abstract method that must be defined to make a working RandomElement.-
Methods inherited from class edu.cornell.lassp.houle.RngPack.RandomSeedable
ClockSeed, ClockSeed
-
-
-
-
Constructor Detail
-
RanMT
public RanMT()
-
RanMT
public RanMT(long seed)
-
RanMT
public RanMT(java.util.Date d)
-
RanMT
public RanMT(int[] array)
If a 32 bit seed isn't enough for you, you can pass an array of 624 integers. Any array of integers is fine so long as they aren't all zero.
-
-
Method Detail
-
raw
public final double raw()
Description copied from class:RandomElementThe abstract method that must be defined to make a working RandomElement. See the classRandomJavafor an example of how to do this.- Specified by:
rawin classRandomElement- Returns:
- a random double in the range [0,1]
- See Also:
RandomJava
-
-
DMelt 3.0 © DataMelt by jWork.ORG