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/base/PyomoModel.py

    r2053 r2064  
    1818import pyutilib.plugin.core
    1919from pyutilib.math import *
    20 from pyutilib.misc import quote_split, tuplize
     20from pyutilib.misc import quote_split, tuplize, Container
    2121
    2222from coopr.opt import ProblemFormat, ResultsFormat, guess_format
     
    7474        self._con = {}
    7575        self._obj = {}
     76        #
     77        # Model statistics
     78        #
     79        self.statistics = Container()
    7680
    7781    def components(self, ctype=None):
     
    8387
    8488    def nvariables(self):
    85         return len(self._var)
     89        return self.statistics.number_of_variables
    8690
    8791    def variable(self, name):
     
    9599
    96100    def nconstraints(self):
    97         return len(self._con)
     101        return self.statistics.number_of_constraints
    98102
    99103    def constraint(self, name):
     
    107111
    108112    def nobjectives(self):
    109         return len(self._obj)
     113        return self.statistics.number_of_objectives
    110114
    111115    def objective(self, name):
Note: See TracChangeset for help on using the changeset viewer.