public void CanFillSampleArrayStatic() { double[] samples = new double[100]; TruncatedPareto.Samples(new Numerics.Random.MersenneTwister(100), samples, 10.0, 10.0, 1000.0); Assert.IsTrue(!samples.Any(x => x == 0)); }
public void FailFillingSampleArrayStatic() { double[] samples = new double[100]; Assert.That(() => { TruncatedPareto.Samples(new Numerics.Random.MersenneTwister(100), samples, 10.0, 10.0, 5.0); }, Throws.ArgumentException); }
public void FailSampleSequenceStatic() { Assert.That(() => { var ied = TruncatedPareto.Samples(new Numerics.Random.MersenneTwister(100), 10.0, 10.0, 5.0).First(); }, Throws.ArgumentException); }
public void CanSampleSequenceStatic() { var ied = TruncatedPareto.Samples(new Numerics.Random.MersenneTwister(100), 10.0, 10.0, 1000.0); GC.KeepAlive(ied.Take(5).ToArray()); }