Example #1
0
File: Lab2.cs Project: MatyasovM/pi
        public static void Do()
        {
            int L         = 5;
            var aMaxValue = Math.Pow(2, L) - 1;

            myValues = General.GenerateSearceSpace(aMaxValue);
            //#3
            //variant 2
            Console.WriteLine("Computing of landscape...");
            foreach (var aVal in myValues)
            {
                var aU = Math.Pow(aVal.Data - Math.Pow(2, L - 1), 2);
                myKeys.Add(aU);
            }

            //#4
            Console.WriteLine("Applying of algorithm...");
            Algorithm();
        }
Example #2
0
        public static void Do()
        {
            int L            = 15;
            var aMaxValue    = Math.Pow(2, L) - 1;
            var aSearchSpace = General.GenerateSearceSpace(aMaxValue);

            //#3
            //variant 2
            Console.WriteLine("Computing of landscape...");
            Hashtable aLandscape = new Hashtable();

            foreach (var aVal in aSearchSpace)
            {
                aLandscape.Add(aVal.Data, aVal);
            }

            //#4
            Console.WriteLine("Applying of algorithm...");
            Algorithm(aLandscape);
        }