[ 
https://issues.apache.org/jira/browse/MATH-290?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12747797#action_12747797
 ] 

Andrea commented on MATH-290:
-----------------------------

Hi Ben, what you say in your last comment is not true. There is no feasible 
solution to my problem...
Maybe I should have expressed it in "human" readable format:

min: 1 x + 5 y;
r1: 2 x + 0 y <= -1;
x >= 0;
y >= 0;

x = 0 and y = 0 is not a valid solution since 2 * 0 + 0 * 0 (=0) is not <= -1...

The "trick" is that there will be never non-negative variables (in this case 
[x, y]) that multiplied with non-negative coefficients (here [2, 0]) will 
produce a negative result.

Do you agree?

> 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.

Reply via email to