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

    java.lang.Object
      org.apache.commons.math.random.UniformRandomGenerator

All Implemented Interfaces:
  NormalizedRandomGenerator

    public class UniformRandomGenerator

extends Object
implements NormalizedRandomGenerator

This class implements a normalized uniform random generator.

Since it is a normalized random generator, it generates values from a uniform distribution with mean equal to 0 and standard deviation equal to 1. Generated values fall in the range [-√3, +√3].

Since:
  1.2
Version:
  $Revision: 990655 $ $Date: 2010-08-29 23:49:40 +0200 (dim. 29 août 2010) $

Field Summary
`private RandomGenerator` `generator` Underlying generator.
`private static long` `serialVersionUID` Serializable version identifier.
`private static double` `SQRT3` Square root of three.

Constructor Summary
`UniformRandomGenerator(RandomGenerator generator)` Create a new generator.

Method Summary
`double` `nextNormalizedDouble()` Generate a random scalar with null mean and unit standard deviation.

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

### SQRT3

    private static final double SQRT3

  Square root of three.

### generator

    private final RandomGenerator generator

  Underlying generator.

Constructor Detail

### UniformRandomGenerator

    public UniformRandomGenerator(RandomGenerator generator)

  Create a new generator.

  Parameters:
    `generator` - underlying random generator to use

Method Detail

### nextNormalizedDouble

    public double nextNormalizedDouble()

  Generate a random scalar with null mean and unit standard deviation.

  The number generated is uniformly distributed between -&sqrt;(3) and +&sqrt;(3).

  Specified by:
    `nextNormalizedDouble` in interface `NormalizedRandomGenerator`
  Returns:
    a random scalar with null mean and unit standard deviation

Copyright (c) 2003-2013 Apache Software Foundation