Changeset 3084


Ignore:
Timestamp:
Oct 12, 2010 11:12:17 PM (11 years ago)
Author:
jwatson
Message:

Fixed bug in constraint stage determination code in PySP - forgot to ignore constant terms, which of course don't have variables!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • coopr.pysp/trunk/coopr/pysp/scenariotree.py

    r3075 r3084  
    751751      largest_stage_index = -1
    752752      largest_stage = None
    753      
     753
    754754      canonical_repn = constraint[index].repn
    755755      for degree, terms in canonical_repn.items():
    756          if degree != -1:
     756         if (degree != -1) and (degree != 0): # ignore constant terms and the variable definitions themselves.
    757757            for var_key, coefficient in terms.items():
    758758               var_value = canonical_repn[-1][var_key.keys()[0]]
Note: See TracChangeset for help on using the changeset viewer.