Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.commons.math.random
Class Well1024a

    java.lang.Object
      org.apache.commons.math.random.BitsStreamGenerator
          org.apache.commons.math.random.AbstractWell
              org.apache.commons.math.random.Well1024a

All Implemented Interfaces:
  Serializable, RandomGenerator

    public class Well1024a

extends AbstractWell

This class implements the WELL1024a pseudo-random number generator from François Panneton, Pierre L'Ecuyer and Makoto Matsumoto.

This generator is described in a paper by François Panneton, Pierre L'Ecuyer and Makoto Matsumoto Improved Long-Period Generators Based on Linear Recurrences Modulo 2 ACM Transactions on Mathematical Software, 32, 1 (2006). The errata for the paper are in wellrng-errata.txt.

Since:
  2.2
Version:
  $Revision: 1003892 $ $Date: 2010-10-02 23:28:56 +0200 (sam. 02 oct. 2010) $
See Also:
  WELL Random number generator, Serialized Form

Field Summary
`private static int` | `K` Number of bits in the pool.
`private static int` | `M1` First parameter of the algorithm.
`private static int` | `M2` Second parameter of the algorithm.
`private static int` | `M3` Third parameter of the algorithm.
`private static long` | `serialVersionUID` Serializable version identifier.

Fields inherited from class org.apache.commons.math.random.AbstractWell
`i1, i2, i3, index, iRm1, iRm2, v`

Constructor Summary
`Well1024a()` Creates a new random number generator.
`Well1024a(int seed)` Creates a new random number generator using a single int seed.
`Well1024a(int[] seed)` Creates a new random number generator using an int array seed.
`Well1024a(long seed)` Creates a new random number generator using a single long seed.

Method Summary
`protected int` | `next(int bits)` Generate next pseudorandom number.

Methods inherited from class org.apache.commons.math.random.AbstractWell
`setSeed, setSeed, setSeed`

Methods inherited from class org.apache.commons.math.random.BitsStreamGenerator
`nextBoolean, nextBytes, nextDouble, nextFloat, nextGaussian, nextInt, nextInt, nextLong`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### serialVersionUID

    private static final long serialVersionUID

  Serializable version identifier.

  See Also:
    Constant Field Values

### K

    private static final int K

  Number of bits in the pool.

  See Also:
    Constant Field Values

### M1

    private static final int M1

  First parameter of the algorithm.

  See Also:
    Constant Field Values

### M2

    private static final int M2

  Second parameter of the algorithm.

  See Also:
    Constant Field Values

### M3

    private static final int M3

  Third parameter of the algorithm.

  See Also:
    Constant Field Values

Constructor Detail

### Well1024a

    public Well1024a()

  Creates a new random number generator.

  The instance is initialized using the current time as the seed.

### Well1024a

    public Well1024a(int seed)

  Creates a new random number generator using a single int seed.

  Parameters:
    `seed` - the initial seed (32 bits integer)

### Well1024a

    public Well1024a(int[] seed)

  Creates a new random number generator using an int array seed.

  Parameters:
    `seed` - the initial seed (32 bits integers array), if null the seed of the generator will be related to the current time

### Well1024a

    public Well1024a(long seed)

  Creates a new random number generator using a single long seed.

  Parameters:
    `seed` - the initial seed (64 bits integer)

Method Detail

### next

    protected int next(int bits)

  Generate next pseudorandom number.

  This method is the core generation algorithm. It is used by all the public generation methods for the various primitive types `BitsStreamGenerator.nextBoolean()`, `BitsStreamGenerator.nextBytes(byte[])`, `BitsStreamGenerator.nextDouble()`, `BitsStreamGenerator.nextFloat()`, `BitsStreamGenerator.nextGaussian()`, `BitsStreamGenerator.nextInt()`, `BitsStreamGenerator.next(int)` and `BitsStreamGenerator.nextLong()`.

  Specified by:
    `next` in class `AbstractWell`
  Parameters:
    `bits` - number of random bits to produce
  Returns:
    random bits generated

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright (c) 2003-2013 Apache Software Foundation