Class CLGaussianRng<TRng>
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
TRngThe 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
sourceCLGaussianRng<TRng>The generator to copy, deeply.
Exceptions
- ArgumentNullException
sourceis null.
CLGaussianRng(TRng)
Initializes a new instance of the CLGaussianRng<TRng> class.
public CLGaussianRng(TRng uniformGenerator)
Parameters
uniformGeneratorTRngThe uniform generator, which the generator copies.
Exceptions
- ArgumentNullException
uniformGeneratoris 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()