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

Negative value with restrictNonNegative

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2
    • Fix Version/s: 3.0
    • Environment:

      commons-math-2.2

      Description

      Problem: commons-math-2.2 SimplexSolver.

      A variable with 0 coefficient may be assigned a negative value nevertheless restrictToNonnegative flag in call:
      SimplexSolver.optimize(function, constraints, GoalType.MINIMIZE, true);

      Function
      1 * x + 1 * y + 0

      Constraints:
      1 * x + 0 * y = 1

      Result:
      x = 1; y = -1;

      Probably variables with 0 coefficients are omitted at some point of computation and because of that the restrictions do not affect their values.

        Attachments

        1. MATH-713.patch
          2 kB
          Thomas Neidhart

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              mskrzypczak MichaƂ Skrzypczak
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 3h
                3h
                Remaining:
                Remaining Estimate - 3h
                3h
                Logged:
                Time Spent - Not Specified
                Not Specified