Table of Contents

Class CLGaussianRng<TRng>

Namespace
NanoQL.Numerics
Assembly
NanoQL.dll

The Gaussian random-number generator by the well-known fact that the sum of 12 uniform deviates in (−0.5, 0.5) is approximately a Gaussian deviate with average 0 and standard deviation 1; the uniform deviates are supplied by TRng.

[WorkingType]
public class CLGaussianRng<TRng> : IRng where TRng : class, IRng

Type Parameters

TRng

The uniform generator, of deviates in (0, 1).

Inheritance
CLGaussianRng<TRng>
Implements
Derived
Inherited Members

Remarks

A mutable working type: each draw changes it, and it is not thread-safe. It copies the generator it is given, so the caller's later draws change nothing in it.

Constructors

CLGaussianRng(CLGaussianRng<TRng>)

Initializes a new instance of the CLGaussianRng<TRng> class from a copy of another, for a subclass's Clone().

protected CLGaussianRng(CLGaussianRng<TRng> source)

Parameters

source CLGaussianRng<TRng>

The generator to copy, deeply.

Exceptions

ArgumentNullException

source is null.

CLGaussianRng(TRng)

Initializes a new instance of the CLGaussianRng<TRng> class.

public CLGaussianRng(TRng uniformGenerator)

Parameters

uniformGenerator TRng

The uniform generator, which the generator copies.

Exceptions

ArgumentNullException

uniformGenerator is null.

Methods

Clone()

Copies the generator deeply, its uniform generator included: the copy's next draw equals this one's, and the two change apart.

public virtual CLGaussianRng<TRng> Clone()

Returns

CLGaussianRng<TRng>

The copy.

Next()

Draws a sample from a Gaussian distribution.

public Sample<double> Next()

Returns

Sample<double>

The sample, with the product of the twelve uniform draws' weights.