Uploaded image for project: 'Commons Math'
  1. Commons Math
  2. MATH-290

NullPointerException in SimplexTableau.initialize

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0
    • 2.1
    • None
    • None
    • Java 1.6.0_13 on Windows XP 32-bit

    Description

      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

      Attachments

        1. SimplexSolverTest.patch
          4 kB
          Benjamin McCann
        2. SimplexTableau.patch
          8 kB
          Benjamin McCann

        Activity

          People

            Unassigned Unassigned
            ciaccia Andrea
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: