[
https://issues.apache.org/jira/browse/MATH-290?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Benjamin McCann updated MATH-290:
---------------------------------
Attachment: SimplexTableau.patch
SimplexSolverTest.patch
Thanks for the bug report. I'm glad to be finding these bugs (hopefully the
last of them :o) That was the point in open sourcing this, so looks like that
was a good decision!
Problem here was that when the constraint's right hand side is negative, we
need to flip the constraint around so that it is positive. We were doing that
too late during the initialization and it should have been done at the very
beginning, so that we only deal with the normalized version instead of both
versions.
> NullPointerException in SimplexTableau.initialize
> -------------------------------------------------
>
> Key: MATH-290
> URL: https://issues.apache.org/jira/browse/MATH-290
> Project: Commons Math
> Issue Type: Bug
> Affects Versions: 2.0
> Environment: Java 1.6.0_13 on Windows XP 32-bit
> Reporter: Andrea
> Attachments: SimplexSolverTest.patch, SimplexTableau.patch
>
>
> SimplexTableau throws a NullPointerException when no solution can be found
> instead of a NoFeasibleSolutionException
> Here is the code that causes the NullPointerException:
> LinearObjectiveFunction f = new LinearObjectiveFunction(new double[] { 1, 5
> }, 0 );
> Collection<LinearConstraint> constraints = new ArrayList<LinearConstraint>();
> constraints.add(new LinearConstraint(new double[] { 2, 0 }, Relationship.GEQ,
> -1.0));
> RealPointValuePair solution = new SimplexSolver().optimize(f, constraints,
> GoalType.MINIMIZE, true);
> Note: Tested both with Apache Commons Math 2.0 release and SVN trunk
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.