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 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");
		}
Esempio n. 3
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. 4
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);


    }
Esempio n. 5
0
    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();
    }