Examples of SimpleVectorialValueChecker


Examples of org.apache.commons.math.optimization.SimpleVectorialValueChecker

    public void testTrivial() throws FunctionEvaluationException, OptimizationException {
        LinearProblem problem =
            new LinearProblem(new double[][] { { 2 } }, new double[] { 3 });
        GaussNewtonOptimizer optimizer = new GaussNewtonOptimizer(true);
        optimizer.setMaxIterations(100);
        optimizer.setConvergenceChecker(new SimpleVectorialValueChecker(1.0e-6, 1.0e-6));
        VectorialPointValuePair optimum =
            optimizer.optimize(problem, problem.target, new double[] { 1 }, new double[] { 0 });
        assertEquals(0, optimizer.getRMS(), 1.0e-10);
        assertEquals(1.5, optimum.getPoint()[0], 1.0e-10);
        assertEquals(3.0, optimum.getValue()[0], 1.0e-10);
View Full Code Here

Examples of org.apache.commons.math.optimization.SimpleVectorialValueChecker

            new LinearProblem(new double[][] { { 1.0, -1.0 }, { 0.0, 2.0 }, { 1.0, -2.0 } },
                              new double[] { 4.0, 6.0, 1.0 });

        GaussNewtonOptimizer optimizer = new GaussNewtonOptimizer(true);
        optimizer.setMaxIterations(100);
        optimizer.setConvergenceChecker(new SimpleVectorialValueChecker(1.0e-6, 1.0e-6));
        VectorialPointValuePair optimum =
            optimizer.optimize(problem, problem.target, new double[] { 1, 1, 1 }, new double[] { 0, 0 });
        assertEquals(0, optimizer.getRMS(), 1.0e-10);
        assertEquals(7.0, optimum.getPoint()[0], 1.0e-10);
        assertEquals(3.0, optimum.getPoint()[1], 1.0e-10);
View Full Code Here

Examples of org.apache.commons.math.optimization.SimpleVectorialValueChecker

                { 0, 0, 0, 0, 2, 0 },
                { 0, 0, 0, 0, 0, 2 }
        }, new double[] { 0.0, 1.1, 2.2, 3.3, 4.4, 5.5 });
        GaussNewtonOptimizer optimizer = new GaussNewtonOptimizer(true);
        optimizer.setMaxIterations(100);
        optimizer.setConvergenceChecker(new SimpleVectorialValueChecker(1.0e-6, 1.0e-6));
        VectorialPointValuePair optimum =
            optimizer.optimize(problem, problem.target, new double[] { 1, 1, 1, 1, 1, 1 },
                               new double[] { 0, 0, 0, 0, 0, 0 });
        assertEquals(0, optimizer.getRMS(), 1.0e-10);
        for (int i = 0; i < problem.target.length; ++i) {
View Full Code Here

Examples of org.apache.commons.math.optimization.SimpleVectorialValueChecker

                { -11, 0 },
                0, -1, 1 }
        }, new double[] { 1, 1, 1});
        GaussNewtonOptimizer optimizer = new GaussNewtonOptimizer(true);
        optimizer.setMaxIterations(100);
        optimizer.setConvergenceChecker(new SimpleVectorialValueChecker(1.0e-6, 1.0e-6));
        VectorialPointValuePair optimum =
            optimizer.optimize(problem, problem.target, new double[] { 1, 1, 1 }, new double[] { 0, 0, 0 });
        assertEquals(0, optimizer.getRMS(), 1.0e-10);
        assertEquals(1.0, optimum.getPoint()[0], 1.0e-10);
        assertEquals(2.0, optimum.getPoint()[1], 1.0e-10);
View Full Code Here

Examples of org.apache.commons.math.optimization.SimpleVectorialValueChecker

                00,   00,       1, 1 }
        }, new double[] { 2, -9, 2, 2, 1 + epsilon * epsilon, 2});

        GaussNewtonOptimizer optimizer = new GaussNewtonOptimizer(true);
        optimizer.setMaxIterations(100);
        optimizer.setConvergenceChecker(new SimpleVectorialValueChecker(1.0e-6, 1.0e-6));
        VectorialPointValuePair optimum =
            optimizer.optimize(problem, problem.target, new double[] { 1, 1, 1, 1, 1, 1 },
                               new double[] { 0, 0, 0, 0, 0, 0 });
        assertEquals(0, optimizer.getRMS(), 1.0e-10);
        assertEquals( 3.0, optimum.getPoint()[0], 1.0e-10);
View Full Code Here

Examples of org.apache.commons.math.optimization.SimpleVectorialValueChecker

                2, 13 },
                { -3, 0, -9 }
        }, new double[] { 1, 1, 1 });
        GaussNewtonOptimizer optimizer = new GaussNewtonOptimizer(true);
        optimizer.setMaxIterations(100);
        optimizer.setConvergenceChecker(new SimpleVectorialValueChecker(1.0e-6, 1.0e-6));
        try {
            optimizer.optimize(problem, problem.target, new double[] { 1, 1, 1 }, new double[] { 0, 0, 0 });
            fail("an exception should have been caught");
        } catch (OptimizationException ee) {
            // expected behavior
View Full Code Here

Examples of org.apache.commons.math.optimization.SimpleVectorialValueChecker

                8.0, 6.0, 10.09.0 },
                7.0, 5.09.0, 10.0 }
        }, new double[] { 32, 23, 33, 31 });
        GaussNewtonOptimizer optimizer = new GaussNewtonOptimizer(true);
        optimizer.setMaxIterations(100);
        optimizer.setConvergenceChecker(new SimpleVectorialValueChecker(1.0e-6, 1.0e-6));
        VectorialPointValuePair optimum1 =
            optimizer.optimize(problem1, problem1.target, new double[] { 1, 1, 1, 1 },
                               new double[] { 0, 1, 2, 3 });
        assertEquals(0, optimizer.getRMS(), 1.0e-10);
        assertEquals(1.0, optimum1.getPoint()[0], 1.0e-10);
View Full Code Here

Examples of org.apache.commons.math.optimization.SimpleVectorialValueChecker

                { 2.0, 0.01.0, 0.0 }
        }, new double[] { 7.0, 3.0, 5.0 });

        GaussNewtonOptimizer optimizer = new GaussNewtonOptimizer(true);
        optimizer.setMaxIterations(100);
        optimizer.setConvergenceChecker(new SimpleVectorialValueChecker(1.0e-6, 1.0e-6));
        try {
            optimizer.optimize(problem, problem.target, new double[] { 1, 1, 1 },
                               new double[] { 7, 6, 5, 4 });
            fail("an exception should have been caught");
        } catch (OptimizationException ee) {
View Full Code Here

Examples of org.apache.commons.math.optimization.SimpleVectorialValueChecker

                 { 0.0, 0.0, -1.01.0, 0.01.0 },
                 { 0.0, 0.00.0, -1.0, 1.00.0 }
        }, new double[] { 3.0, 12.0, -1.0, 7.0, 1.0 });
        GaussNewtonOptimizer optimizer = new GaussNewtonOptimizer(true);
        optimizer.setMaxIterations(100);
        optimizer.setConvergenceChecker(new SimpleVectorialValueChecker(1.0e-6, 1.0e-6));
        try {
            optimizer.optimize(problem, problem.target, new double[] { 1, 1, 1, 1, 1 },
                               new double[] { 2, 2, 2, 2, 2, 2 });
            fail("an exception should have been caught");
        } catch (OptimizationException ee) {
View Full Code Here

Examples of org.apache.commons.math.optimization.SimpleVectorialValueChecker

                { 1.03.0 }
        }, new double[] { 3.0, 1.0, 5.0 });

        GaussNewtonOptimizer optimizer = new GaussNewtonOptimizer(true);
        optimizer.setMaxIterations(100);
        optimizer.setConvergenceChecker(new SimpleVectorialValueChecker(1.0e-6, 1.0e-6));
        VectorialPointValuePair optimum =
            optimizer.optimize(problem, problem.target, new double[] { 1, 1, 1 },
                               new double[] { 1, 1 });
        assertEquals(0, optimizer.getRMS(), 1.0e-10);
        assertEquals(2.0, optimum.getPoint()[0], 1.0e-8);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.