Ignore:
Timestamp:
Dec 29, 2009 5:16:16 PM (10 years ago)
Author:
wehart
Message:

Misc rework of variable presolving. Now, model
statistics are stored in a more obvious location, and using more
verbose names.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • coopr.pyomo/trunk/coopr/pyomo/presolve/identify_vars.py

    r1993 r2064  
    7070                tmp.id = self.vnum
    7171                model._var[self.vnum] = tmp
     72            if model._var[self.vnum].is_binary():
     73                model.statistics.number_of_binary_variables += 1
     74            elif model._var[self.vnum].is_integer():
     75                model.statistics.number_of_integer_variables += 1
     76            else:
     77                model.statistics.number_of_continuous_variables +=1
    7278            self.vnum += 1
    7379        #
     
    8894        self.cnum=0
    8995        self.onum=0
     96        model.statistics.number_of_binary_variables = 0
     97        model.statistics.number_of_integer_variables = 0
     98        model.statistics.number_of_continuous_variables = 0
    9099        #
    91100        # Indicate that all variables are unused
     
    122131                model._con[self.cnum] = C._data[cndx]
    123132                self.cnum += 1
    124         model.vnum=self.vnum
    125         model.cnum=self.cnum
    126         model.onum=self.onum
     133        model.statistics.number_of_variables=self.vnum
     134        model.statistics.number_of_constraints=self.cnum
     135        model.statistics.number_of_objectives=self.onum
    127136        return model
    128137
Note: See TracChangeset for help on using the changeset viewer.