Changeset 5778


Ignore:
Timestamp:
May 15, 2012 1:01:30 PM (7 years ago)
Author:
jwatson
Message:

Fixing issue with CPLEX plugin where only non-zero slacks and duals were being added to the results object, resulting in "None" values on the instance when solutions were loaded.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • coopr.plugins/trunk/coopr/plugins/solvers/CPLEX.py

    r5544 r5778  
    486486                        constraint = soln.constraint[constraint_name]
    487487                    elif (extract_duals is True) and (field_name == "dual"): # for LPs
    488                         # assumes the name field is first.
    489                         if float(field_value) != 0.0:
    490                             constraint.dual = float(field_value)
     488                        constraint.dual = float(field_value)
    491489                    elif (extract_slacks is True) and (field_name == "slack"): # for MIPs
    492                         # assumes the name field is first.
    493                         if float(field_value) != 0.0:
    494                             constraint.slack = float(field_value)
     490                        constraint.slack = float(field_value)
    495491            elif tokens[0].startswith("problemName"):
    496492                filename = (string.strip(tokens[0].split('=')[1])).lstrip("\"").rstrip("\"")
Note: See TracChangeset for help on using the changeset viewer.