commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l..@apache.org
Subject svn commit: r812921 - /commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/linear/SimplexSolverTest.java
Date Wed, 09 Sep 2009 12:22:15 GMT
Author: luc
Date: Wed Sep  9 12:22:14 2009
New Revision: 812921

URL: http://svn.apache.org/viewvc?rev=812921&view=rev
Log:
applied Andrea's patch to improve test
JIRA: MATH-286

Modified:
    commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/linear/SimplexSolverTest.java

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/linear/SimplexSolverTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/linear/SimplexSolverTest.java?rev=812921&r1=812920&r2=812921&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/linear/SimplexSolverTest.java
(original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/linear/SimplexSolverTest.java
Wed Sep  9 12:22:14 2009
@@ -58,7 +58,13 @@
 
         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



Mime
View raw message