Changeset 2125


Ignore:
Timestamp:
Jan 3, 2010 7:00:33 PM (11 years ago)
Author:
wehart
Message:

Extended collection of linear terms to ignore identity expressions in a
ProductExpression?.

Misc documentation update in Pyomo.

If there is no rule, then Constraint.construct() does _not_ clear the constraint
set. This had the unfortunate side-effect that user-added constraints are
cleared!

Location:
coopr.pyomo/trunk/coopr/pyomo
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • coopr.pyomo/trunk/coopr/pyomo/base/constraint.py

    r2122 r2125  
    284284           print "Construcing constraint "+self.name
    285285        if self.rule is None:
    286            self._data={}
    287286           return
    288287        #
  • coopr.pyomo/trunk/coopr/pyomo/main_script.py

    r2036 r2125  
    346346    opt = SolverFactory( options.solver )
    347347    if opt is None:
    348        raise ValueError, "Problem constructing solver `"+str(options.solver)+"'"
     348       raise ValueError, "Unknown problem constructing solver `"+str(options.solver)+"'"
    349349    opt.keepFiles=options.keepfiles or options.log
    350350    if options.timelimit == 0:
  • coopr.pyomo/trunk/coopr/pyomo/presolve/collect_linear_terms.py

    r1993 r2125  
    6767              ve = v = "0"
    6868              for e in exp._numerator:
     69                 while isinstance(e,expr._IdentityExpression):
     70                        e = e._args[0]
    6971                 if e.fixed_value():
    7072                     # at this point, we have checked that the expression has a fixed value.
Note: See TracChangeset for help on using the changeset viewer.