/// <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); }
/// <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)); }
/// <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); }
/// <summary> /// Take a sample from the distribution. /// </summary> /// <returns>A random sample.</returns> public double Sample() { return(ZigguratGaussian.Sample(_rng, _mean, _stdDev)); }
/// <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); }
/// <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); }