static void Main(string[] args) { Console.WriteLine(new String('-', 16)); Console.WriteLine("| {0,3} | {1,6} |", "N", "Second"); Console.WriteLine(new String('-', 16)); for (int i = 2; i < 31; i++) { Console.WriteLine("| {0,3} | {1,6} |", i, GradientSpysk.GetMin(f, new X(i, f), 0.5, 0.001)); } Console.WriteLine(new String('-', 16)); Console.ReadKey(); }
static void Main(string[] args) { X gs = GradientSpysk.GetMin(f, x0, 0.1, 0.001); Console.WriteLine("F(x) => min When x = " + gs); Console.WriteLine(); X fgs = FastGradientSpysk.GetMin(f, x0, 0.1, 0.001); Console.WriteLine("F(x) => min When x = " + fgs); Console.WriteLine(); X fr = FletcheraRivsa.GetMin(f, x0, 0.1, 0.001); Console.WriteLine("F(x) => min When x = " + fr); Console.ReadKey(); }