org.encog.mathutil.randomize.generate

## Class MultiplyWithCarryGenerateRandom

- java.lang.Object
- - org.encog.mathutil.randomize.generate.AbstractGenerateRandom
  - - org.encog.mathutil.randomize.generate.AbstractBoxMuller
    - - org.encog.mathutil.randomize.generate.MultiplyWithCarryGenerateRandom

- All Implemented Interfaces:
    GenerateRandom

      public class MultiplyWithCarryGenerateRandom
      extends AbstractBoxMuller

  In Multiply with Carry (MWC) is a pseudo random number generator computer science, multiply-with-carry (MWC) is a method invented by George Marsaglia for generating sequences of random integers based on an initial set from two to many thousands of randomly chosen seed values. The main advantages of the MWC method are that it invokes simple computer integer arithmetic and leads to very fast generation of sequences of random numbers with immense periods.

  This class was implemented using information from the following sources:

  http://www.javaprogrammingforums.com/blogs/helloworld922/11-complimentary-multiply-carry-better-way-generate-pseudo-random-numbers.html http://en.wikipedia.org/wiki/Multiply-with-carry

- - ### Field Summary

    - ### Fields inherited from class org.encog.mathutil.randomize.generate.AbstractBoxMuller

      `MU`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MultiplyWithCarryGenerateRandom()`
    `MultiplyWithCarryGenerateRandom(long seed)`
    `MultiplyWithCarryGenerateRandom(long[] seeds, long carry, int r, long multiplier)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `nextBoolean()`
    `double` | `nextDouble()`
    `float` | `nextFloat()`
    `int` | `nextInt()`
    `long` | `nextLong()`

    - ### Methods inherited from class org.encog.mathutil.randomize.generate.AbstractBoxMuller

      `nextGaussian`

    - ### Methods inherited from class org.encog.mathutil.randomize.generate.AbstractGenerateRandom

      `nextDouble, nextDouble, nextInt, nextInt`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### MultiplyWithCarryGenerateRandom

          public MultiplyWithCarryGenerateRandom(long seed)

    - #### MultiplyWithCarryGenerateRandom

          public MultiplyWithCarryGenerateRandom()

    - #### MultiplyWithCarryGenerateRandom

          public MultiplyWithCarryGenerateRandom(long[] seeds,
                                         long carry,
                                         int r,
                                         long multiplier)

  - ### Method Detail

    - #### nextDouble

          public double nextDouble()

      Returns:
        The next random double.

    - #### nextLong

          public long nextLong()

      Returns:
        The next random long.

    - #### nextBoolean

          public boolean nextBoolean()

      Returns:
        The next random boolean.

    - #### nextFloat

          public float nextFloat()

      Returns:
        The next random floating point.

    - #### nextInt

          public int nextInt()

      Returns:
        The next random integer.

Copyright © 2014. All Rights Reserved.