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/var.py

    r2025 r2064  
    8686            return True
    8787        return False
     88
     89    def is_binary(self):
     90        return self.var.is_binary()
     91
     92    def is_integer(self):
     93        return self.var.is_integer()
     94
     95    def is_continuous(self):
     96        return self.var.is_continuous()
    8897
    8998    def simplify(self, model):
     
    214223        except KeyError:
    215224            raise KeyError, "Unknown index " + str(ndx) + " in variable " + self.name
     225
     226    def is_binary(self):
     227        return isinstance(self.domain, BooleanSet)
     228
     229    def is_integer(self):
     230        return isinstance(self.domain, IntegerSet)
     231
     232    def is_continuous(self):
     233        return not (self.is_binary() or self.is_integer())
    216234
    217235    def simplify(self, model):
Note: See TracChangeset for help on using the changeset viewer.