From d2ba1651edfe40981d1fc163af89d168c5679c1f Mon Sep 17 00:00:00 2001 From: Luc Maisonobe Date: Wed, 9 Sep 2009 12:22:14 +0000 Subject: [PATCH] applied Andrea's patch to improve test JIRA: MATH-286 git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@812921 13f79535-47bb-0310-9956-ffa450edef68 --- .../commons/math/optimization/linear/SimplexSolverTest.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/test/java/org/apache/commons/math/optimization/linear/SimplexSolverTest.java b/src/test/java/org/apache/commons/math/optimization/linear/SimplexSolverTest.java index a2502d6c2..ba2c64222 100644 --- a/src/test/java/org/apache/commons/math/optimization/linear/SimplexSolverTest.java +++ b/src/test/java/org/apache/commons/math/optimization/linear/SimplexSolverTest.java @@ -58,7 +58,13 @@ public class SimplexSolverTest { SimplexSolver solver = new SimplexSolver(); RealPointValuePair solution = solver.optimize(f, constraints, GoalType.MAXIMIZE, true); + Assert.assertEquals(25.8, solution.getValue(), .0000001); + Assert.assertEquals(23.0, solution.getPoint()[0] + solution.getPoint()[2] + solution.getPoint()[4], 0.0000001); + Assert.assertEquals(23.0, solution.getPoint()[1] + solution.getPoint()[3] + solution.getPoint()[5], 0.0000001); + Assert.assertTrue(solution.getPoint()[0] >= 10.0 - 0.0000001); + Assert.assertTrue(solution.getPoint()[2] >= 8.0 - 0.0000001); + Assert.assertTrue(solution.getPoint()[4] >= 5.0 - 0.0000001); } @Test