Package org.apache.commons.math3.optim

Examples of org.apache.commons.math3.optim.PointValuePair


    @Test
    public void testCigTab() {
        double[] startPoint = point(DIM,1.0);
        double[][] boundaries = null;
        PointValuePair expected =
            new PointValuePair(point(DIM,0.0),0.0);
        doTest(new CigTab(), startPoint, boundaries,
                GoalType.MINIMIZE,
                1e-13, 5e-5, 100, expected);
     }
View Full Code Here


    @Test
    public void testSphere() {
        double[] startPoint = point(DIM,1.0);
        double[][] boundaries = null;
        PointValuePair expected =
            new PointValuePair(point(DIM,0.0),0.0);
        doTest(new Sphere(), startPoint, boundaries,
                GoalType.MINIMIZE,
                1e-13, 1e-6, 100, expected);
    }
View Full Code Here

    @Test
    public void testTablet() {
        double[] startPoint = point(DIM,1.0);
        double[][] boundaries = null;
        PointValuePair expected =
            new PointValuePair(point(DIM,0.0),0.0);
        doTest(new Tablet(), startPoint, boundaries,
                GoalType.MINIMIZE,
                1e-13, 1e-6, 100, expected);
    }
View Full Code Here

    @Test
    public void testDiffPow() {
        double[] startPoint = point(DIM/2,1.0);
        double[][] boundaries = null;
        PointValuePair expected =
            new PointValuePair(point(DIM/2,0.0),0.0);
        doTest(new DiffPow(), startPoint, boundaries,
                GoalType.MINIMIZE,
                1e-8, 1e-1, 12000, expected);
    }
View Full Code Here

    @Test
    public void testSsDiffPow() {
        double[] startPoint = point(DIM/2,1.0);
        double[][] boundaries = null;
        PointValuePair expected =
            new PointValuePair(point(DIM/2,0.0),0.0);
        doTest(new SsDiffPow(), startPoint, boundaries,
                GoalType.MINIMIZE,
                1e-2, 1.3e-1, 50000, expected);
    }
View Full Code Here

    @Test
    public void testAckley() {
        double[] startPoint = point(DIM,0.1);
        double[][] boundaries = null;
        PointValuePair expected =
            new PointValuePair(point(DIM,0.0),0.0);
        doTest(new Ackley(), startPoint, boundaries,
                GoalType.MINIMIZE,
                1e-7, 1e-5, 1000, expected);
    }
View Full Code Here

    @Test
    public void testRastrigin() {
        double[] startPoint = point(DIM,1.0);

        double[][] boundaries = null;
        PointValuePair expected =
            new PointValuePair(point(DIM,0.0),0.0);
        doTest(new Rastrigin(), startPoint, boundaries,
                GoalType.MINIMIZE,
                1e-13, 1e-6, 1000, expected);
    }
View Full Code Here

    @Test
    public void testConstrainedRosen() {
        double[] startPoint = point(DIM,0.1);

        double[][] boundaries = boundaries(DIM,-1,2);
        PointValuePair expected =
            new PointValuePair(point(DIM,1.0),0.0);
        doTest(new Rosen(), startPoint, boundaries,
                GoalType.MINIMIZE,
                1e-13, 1e-6, 2000, expected);
    }
View Full Code Here

        double delta = 0;
        for (int i = 0; i < n; ++i) {
            delta += r[i] * searchDirection[i];
        }

        PointValuePair current = null;
        while (true) {
            incrementIterationCount();

            final double objective = computeObjectiveValue(point);
            PointValuePair previous = current;
            current = new PointValuePair(point, objective);
            if (previous != null && checker.converged(getIterations(), previous, current)) {
                // We have found an optimum.
                return current;
            }

View Full Code Here

        isMinimize = (getGoalType() == GoalType.MINIMIZE);
        currentBest = new ArrayRealVector(getStartPoint());

        final double value = bobyqa(lowerBound, upperBound);

        return new PointValuePair(currentBest.getDataRef(),
                                  isMinimize ? value : -value);
    }
View Full Code Here

TOP

Related Classes of org.apache.commons.math3.optim.PointValuePair

Copyright © 2018 www.massapicom. 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.