Top Description Fields Constructors Methods
org.apache.commons.math3.random

public Class UniformRandomGenerator

extends Object
implements NormalizedRandomGenerator
Class Inheritance
All Implemented Interfaces
org.apache.commons.math3.random.NormalizedRandomGenerator
Imports
org.apache.commons.math3.util.FastMath

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

Field Summary

Modifier and TypeField and Description
private final RandomGenerator
generator

Underlying generator.

private static final double
SQRT3

Square root of three.

Constructor Summary

AccessConstructor and Description
public
UniformRandomGenerator(RandomGenerator
underlying random generator to use
generator
)

Create a new generator.

Method Summary

Modifier and TypeMethod and Description
public double

Returns:

a random scalar with null mean and unit standard deviation
nextNormalizedDouble
()

Implements org.apache.commons.math3.random.NormalizedRandomGenerator.nextNormalizedDouble.

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

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

generatorback to summary
private final RandomGenerator generator

Underlying generator.

SQRT3back to summary
private static final double SQRT3

Square root of three.

Constructor Detail

UniformRandomGeneratorback to summary
public UniformRandomGenerator(RandomGenerator generator)

Create a new generator.

Parameters
generator:RandomGenerator

underlying random generator to use

Method Detail

nextNormalizedDoubleback to summary
public double nextNormalizedDouble()

Implements org.apache.commons.math3.random.NormalizedRandomGenerator.nextNormalizedDouble.

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

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

Returns:double

a random scalar with null mean and unit standard deviation