Changeset 2097


Ignore:
Timestamp:
Jan 2, 2010 12:59:04 AM (10 years ago)
Author:
wehart
Message:

Updating Model statistics after a transformation.

Location:
coopr.pyomo/trunk/coopr/pyomo/transform
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • coopr.pyomo/trunk/coopr/pyomo/transform/eliminate_fixed_vars.py

    r2010 r2097  
    4747            del M._var[ i ]
    4848            if var.fixed:
     49                if var.is_binary():
     50                    M.statistics.number_of_binary_variables -= 1
     51                elif var.is_integer():
     52                    M.statistics.number_of_integer_variables -= 1
     53                elif var.is_continuous():
     54                    M.statistics.number_of_continuous_variables -= 1
     55                M.statistics.number_of_variables -= 1
    4956                del M._name_varmap[ var.label ]
    5057                del var.var._varval[ var.index ]
  • coopr.pyomo/trunk/coopr/pyomo/transform/relax_integrality.py

    r2001 r2097  
    5151                var.domain=Reals
    5252                var._bounds = var.domain._bounds
     53        M.statistics.number_of_binary_variables = 0
     54        M.statistics.number_of_integer_variables = 0
     55        M.statistics.number_of_continuous_variables = len(M._var)
    5356        return M
    5457
Note: See TracChangeset for help on using the changeset viewer.