Index: SimplexSolverTest.java =================================================================== --- SimplexSolverTest.java (revision 781141) +++ SimplexSolverTest.java (working copy) @@ -64,6 +64,18 @@ assertEquals(57.0, solution.getValue(), 0.0); } + @Test + public void testSingleVariableAndConstraint() throws OptimizationException { + LinearObjectiveFunction f = new LinearObjectiveFunction(new double[] { 3 }, 0); + Collection constraints = new ArrayList(); + constraints.add(new LinearConstraint(new double[] { 1 }, Relationship.LEQ, 10)); + + SimplexSolver solver = new SimplexSolver(); + RealPointValuePair solution = solver.optimize(f, constraints, GoalType.MAXIMIZE, false); + assertEquals(10.0, solution.getPoint()[0], 0.0); + assertEquals(30.0, solution.getValue(), 0.0); + } + /** * With no artificial variables needed (no equals and no greater than * constraints) we can go straight to Phase 2.