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"); }
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.Less(result.ChiProbability, 0.01, "ChiProbability is too high, thus System.Random is not really random"); }
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); }
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); }
public static EntCalc.EntCalcResult CalculateFile(ref System.IO.FileStream inStream) { EntCalc entCalc = new EntCalc(false); while (inStream.Position < inStream.Length) { entCalc.AddSample((byte) inStream.ReadByte(), false); } return entCalc.EndCalculation(); }