Exemplo n.º 1
0
        public virtual void TestQNMinimizerRosenbrock()
        {
            double[]      initial = new double[] { 0.0, 0.0 };
            IDiffFunction rf      = new MinimizerTest.RosenbrockFunction();
            QNMinimizer   qn      = new QNMinimizer();

            double[] answer = qn.Minimize(rf, 1e-10, initial);
            System.Console.Error.WriteLine("Answer is: " + Arrays.ToString(answer));
            NUnit.Framework.Assert.AreEqual(1.0, answer[0], 1e-8);
            NUnit.Framework.Assert.AreEqual(1.0, answer[1], 1e-8);
        }
Exemplo n.º 2
0
        public virtual void TestRosenbrock()
        {
            IDiffFunction rf = new MinimizerTest.RosenbrockFunction();

            DiffFunctionTest.GradientCheck(rf);
        }