コード例 #1
0
 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));
 }
コード例 #2
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);
 }
コード例 #3
0
 public void FailSampleSequenceStatic()
 {
     Assert.That(() => { var ied = TruncatedPareto.Samples(new Numerics.Random.MersenneTwister(100), 10.0, 10.0, 5.0).First(); }, Throws.ArgumentException);
 }
コード例 #4
0
        public void CanSampleSequenceStatic()
        {
            var ied = TruncatedPareto.Samples(new Numerics.Random.MersenneTwister(100), 10.0, 10.0, 1000.0);

            GC.KeepAlive(ied.Take(5).ToArray());
        }