LinearProblem problem =
new LinearProblem(new double[][] { { 1.0, -1.0 }, { 0.0, 2.0 }, { 1.0, -2.0 } },
new double[] { 4.0, 6.0, 1.0 });
AbstractLeastSquaresOptimizer optimizer = createOptimizer();
PointVectorValuePair optimum =
optimizer.optimize(100, problem, problem.target, new double[] { 1, 1, 1 }, new double[] { 0, 0 });
Assert.assertEquals(0, optimizer.getRMS(), 1.0e-10);
Assert.assertEquals(7.0, optimum.getPoint()[0], 1.0e-10);
Assert.assertEquals(3.0, optimum.getPoint()[1], 1.0e-10);
Assert.assertEquals(4.0, optimum.getValue()[0], 1.0e-10);
Assert.assertEquals(6.0, optimum.getValue()[1], 1.0e-10);
Assert.assertEquals(1.0, optimum.getValue()[2], 1.0e-10);
}