optimizer.setConvergenceChecker(new SimpleScalarValueChecker(1.0e-13, 1.0e-13));
BrentSolver solver = new BrentSolver();
solver.setAbsoluteAccuracy(1.0e-15);
solver.setRelativeAccuracy(1.0e-15);
optimizer.setLineSearchSolver(solver);
RealPointValuePair optimum1 =
optimizer.optimize(problem1, GoalType.MINIMIZE, new double[] { 0, 1, 2, 3 });
assertEquals(1.0, optimum1.getPoint()[0], 1.0e-5);
assertEquals(1.0, optimum1.getPoint()[1], 1.0e-5);
assertEquals(1.0, optimum1.getPoint()[2], 1.0e-5);
assertEquals(1.0, optimum1.getPoint()[3], 1.0e-5);
LinearProblem problem2 = new LinearProblem(new double[][] {
{ 10.00, 7.00, 8.10, 7.20 },
{ 7.08, 5.04, 6.00, 5.00 },
{ 8.00, 5.98, 9.89, 9.00 },
{ 6.99, 4.99, 9.00, 9.98 }
}, new double[] { 32, 23, 33, 31 });
RealPointValuePair optimum2 =
optimizer.optimize(problem2, GoalType.MINIMIZE, new double[] { 0, 1, 2, 3 });
assertEquals(-81.0, optimum2.getPoint()[0], 1.0e-1);
assertEquals(137.0, optimum2.getPoint()[1], 1.0e-1);
assertEquals(-34.0, optimum2.getPoint()[2], 1.0e-1);
assertEquals( 22.0, optimum2.getPoint()[3], 1.0e-1);
}