Пример #1
0
        public static void Test1()
        {
            Random rand = new Random();
            Histogram hist = new Histogram(10, 0, 1);

            for (int i = 0; i < 10000; i++)
            {
                hist.Add(rand.NextDouble());
            }

            Console.WriteLine("\tTest 1:\n");
            Console.WriteLine("\tFrequency:\n");
            hist.Frequency();
            Console.WriteLine();
            Console.WriteLine("\tCumulative:\n");
            hist.Cumulative();
        }
Пример #2
0
        public static void Test2()
        {
            Random rand = new Random();
            Histogram hist = new Histogram(10, 0, 10);

            for (int i = 0; i < 1000; i++)
            {
                double sum = 0;
                for (int j = 0; j < 10; j++)
                {
                    sum += rand.NextDouble();
                }
                hist.Add(sum);
            }

            Console.WriteLine("\tTest 2:\n");
            Console.WriteLine("\tFrequency:\n");
            hist.Frequency();
            Console.WriteLine();
            Console.WriteLine("\tCumulative:\n");
            hist.Cumulative();
        }