Esempio n. 1
0
        public void TestNotRandomSequence()
        {
            var calc = new EntCalc(false);

            for (int i = 0; i < 100000; ++i)
            {
                calc.AddSample(i, false);
            }

            EntCalc.EntCalcResult result = calc.EndCalculation();
            Assert.Less(result.ChiProbability, 0.01, "ChiProbability is too high, thus MT19937 Generator is not really random");
        }
Esempio n. 2
0
        public static EntCalc.EntCalcResult CalculateFile(string inFileName)
        {
            System.IO.FileStream instream = new System.IO.FileStream(inFileName, System.IO.FileMode.Open, System.IO.FileAccess.Read, System.IO.FileShare.None);

            instream.Position = 0;

            EntCalc.EntCalcResult tmpRes = CalculateFile(ref instream);

            instream.Close();

            return(tmpRes);
        }
Esempio n. 3
0
        public void TestSystemRandom()
        {
            var rand = new System.Random();

            var calc = new EntCalc(false);

            for (int i = 0; i < 100000; ++i)
            {
                calc.AddSample(rand.Next(), false);
            }

            EntCalc.EntCalcResult result = calc.EndCalculation();
            Assert.Less(result.ChiProbability, 0.01, "ChiProbability is too high, thus System.Random is not really random");
        }
Esempio n. 4
0
        public void TestRan002()
        {
            Altaxo.Calc.Probability.Ran002 rand = new Ran002();

            EntCalc calc = new EntCalc(false);

            for (int i = 0; i < 100000; ++i)
            {
                calc.AddSample((int)rand.Long(), false);
            }

            EntCalc.EntCalcResult result = calc.EndCalculation();
            Assert.IsTrue(result.ChiProbability < 0.01);
        }
Esempio n. 5
0
        public void TestSystemRandom()
        {
            System.Random rand = new System.Random();

            EntCalc calc = new EntCalc(false);

            for (int i = 0; i < 100000; ++i)
            {
                calc.AddSample(rand.Next(), false);
            }

            EntCalc.EntCalcResult result = calc.EndCalculation();
            Assert.IsTrue(result.ChiProbability < 0.01);
        }