示例#1
0
        static void Main(string[] args)
        {
            if (!ParseOptions())
            {
                Console.WriteLine("Error parsing options!");
                return;
            }


            GetMinimum.Execute();

            //}
            //Matrix<double> d = DenseMatrix.OfArray(new Double[,] {
            //    {-1},
            //    {-1},
            //    {1},
            //    {1}
            //});

            //Console.WriteLine (String.Concat(">>>> ",d.Transpose().Multiply(Functions.d2f(0,0,0,0)).Multiply(d)));

            //// Iterando sobre o vetor inicial
            //for (int i = 0; i < _x0.Length; i++)
            //{
            //    Console.WriteLine (_x0[i].ToString("0.00"));
            //}

            //// Calculando o passo usando Armijo
            //double t = Armijo.Execute( DenseMatrix.OfArray(new Double[,] { { 1 }, { 0 } }),
            //                           DenseMatrix.OfArray(new Double[,] { { 3 }, { 1 } })
            //                          );


            Matrix <double> x = DenseMatrix.OfArray(new Double[, ] {
                { _x0[0] },
                { _x0[1] },
                { _x0[2] },
                { _x0[3] }
            });


            using (StreamWriter sw = new StreamWriter(@"C:\Users\yagom\Desktop\trab-otim.csv", true))
            {
                sw.WriteLine(String.Format("{0};{1};{2};{3};{4};{5}", "X0", "Iter", "Busca", "Chamada Busca", "Ponto Mínimo", "Valor da função no ponto mínimo"));
                sw.Flush();
            }

            for (double k = 0.1; k < 1.0; k = k + 0.1)
            {
                ExteriorPenalty.Execute(x.Add(-k), 10, 3.0, false);
                ExteriorPenalty.Execute(x.Add(-k), 10, 3.0, true);
            }

            Console.ReadKey();
        }