Esempio n. 1
0
 /// <summary>
 /// Fills the provided span with random samples from the distribution,
 /// using the provided <see cref="IRandomSource"/> as the source of entropy.
 /// </summary>
 /// <param name="span">The span to fill with samples.</param>
 /// <param name="rng">Random source.</param>
 public void Sample(Span <double> span, IRandomSource rng)
 {
     ZigguratGaussian.Sample(rng, span);
 }
Esempio n. 2
0
 /// <summary>
 /// Returns a random sample from the distribution, using the provided <see cref="IRandomSource"/> as the source of entropy.
 /// </summary>
 /// <param name="rng">Random source.</param>
 /// <returns>A new random sample.</returns>
 public double Sample(IRandomSource rng)
 {
     return(ZigguratGaussian.Sample(rng, _mean, _stdDev));
 }
Esempio n. 3
0
 /// <summary>
 /// Fill a span with samples from the distribution.
 /// </summary>
 /// <param name="span">The span to fill with samples.</param>
 public void Sample(Span <double> span)
 {
     ZigguratGaussian.Sample(_rng, span);
 }
Esempio n. 4
0
 /// <summary>
 /// Take a sample from the distribution.
 /// </summary>
 /// <returns>A random sample.</returns>
 public double Sample()
 {
     return(ZigguratGaussian.Sample(_rng, _mean, _stdDev));
 }
Esempio n. 5
0
 /// <summary>
 /// Fill an array with samples from a distribution, using the provided <see cref="IRandomSource"/> as the source of entropy.
 /// </summary>
 /// <param name="buf">The array to fill with samples.</param>
 public void Sample(IRandomSource rng, double[] buf)
 {
     ZigguratGaussian.Sample(rng, buf);
 }
Esempio n. 6
0
 /// <summary>
 /// Fill an array with samples from the distribution.
 /// </summary>
 /// <param name="buf">The array to fill with samples.</param>
 /// <returns>A random sample.</returns>
 public void Sample(double[] buf)
 {
     ZigguratGaussian.Sample(_rng, buf);
 }