Author: luc Date: Mon Jul 20 20:29:07 2009 New Revision: 795996 URL: http://svn.apache.org/viewvc?rev=795996&view=rev Log: improved test coverage
Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/optimization/direct/NelderMeadTest.java commons/proper/math/trunk/src/test/org/apache/commons/math/optimization/general/GaussNewtonOptimizerTest.java Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/optimization/direct/NelderMeadTest.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/optimization/direct/NelderMeadTest.java?rev=795996&r1=795995&r2=795996&view=diff ============================================================================== --- commons/proper/math/trunk/src/test/org/apache/commons/math/optimization/direct/NelderMeadTest.java (original) +++ commons/proper/math/trunk/src/test/org/apache/commons/math/optimization/direct/NelderMeadTest.java Mon Jul 20 20:29:07 2009 @@ -32,6 +32,7 @@ import org.apache.commons.math.optimization.GoalType; import org.apache.commons.math.optimization.OptimizationException; import org.apache.commons.math.optimization.RealPointValuePair; +import org.apache.commons.math.optimization.SimpleRealPointChecker; import org.apache.commons.math.optimization.SimpleScalarValueChecker; import org.junit.Test; @@ -193,7 +194,7 @@ try { Powell powell = new Powell(); NelderMead optimizer = new NelderMead(); - optimizer.setConvergenceChecker(new SimpleScalarValueChecker(-1.0, 1.0e-3)); + optimizer.setConvergenceChecker(new SimpleRealPointChecker(-1.0, 1.0e-3)); optimizer.setMaxEvaluations(20); optimizer.optimize(powell, GoalType.MINIMIZE, new double[] { 3.0, -1.0, 0.0, 1.0 }); } catch (FunctionEvaluationException fee) { Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/optimization/general/GaussNewtonOptimizerTest.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/optimization/general/GaussNewtonOptimizerTest.java?rev=795996&r1=795995&r2=795996&view=diff ============================================================================== --- commons/proper/math/trunk/src/test/org/apache/commons/math/optimization/general/GaussNewtonOptimizerTest.java (original) +++ commons/proper/math/trunk/src/test/org/apache/commons/math/optimization/general/GaussNewtonOptimizerTest.java Mon Jul 20 20:29:07 2009 @@ -32,6 +32,7 @@ import org.apache.commons.math.linear.BlockRealMatrix; import org.apache.commons.math.linear.RealMatrix; import org.apache.commons.math.optimization.OptimizationException; +import org.apache.commons.math.optimization.SimpleVectorialPointChecker; import org.apache.commons.math.optimization.SimpleVectorialValueChecker; import org.apache.commons.math.optimization.VectorialPointValuePair; @@ -385,7 +386,7 @@ circle.addPoint( 45.0, 97.0); GaussNewtonOptimizer optimizer = new GaussNewtonOptimizer(true); optimizer.setMaxIterations(100); - optimizer.setConvergenceChecker(new SimpleVectorialValueChecker(1.0e-15, 1.0e-15)); + optimizer.setConvergenceChecker(new SimpleVectorialPointChecker(1.0e-30, 1.0e-30)); try { optimizer.optimize(circle, new double[] { 0, 0, 0, 0, 0 }, new double[] { 1, 1, 1, 1, 1 },