edu.cornell.lassp.houle.RngPack
Class RanMT

java.lang.Object
  extended byedu.cornell.lassp.houle.RngPack.RandomElement
      extended byedu.cornell.lassp.houle.RngPack.RandomSeedable
          extended byedu.cornell.lassp.houle.RngPack.RanMT
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class RanMT
extends RandomSeedable
implements java.io.Serializable

Mersenne Twister -- advanced psuedorandom generator with a period of 219937-1

Source 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:

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
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
 double raw()
          The abstract method that must be defined to make a working RandomElement.
 
Methods inherited from class edu.cornell.lassp.houle.RngPack.RandomSeedable
ClockSeed, ClockSeed
 
Methods inherited from class edu.cornell.lassp.houle.RngPack.RandomElement
choose, choose, clone, coin, coin, gaussian, gaussian, powlaw, raw, raw, uniform
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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: RandomElement
The abstract method that must be defined to make a working RandomElement. See the class RandomJava for an example of how to do this.

Specified by:
raw in class RandomElement
Returns:
a random double in the range [0,1]
See Also:
RandomJava