Changeset 736

Show
Ignore:
Timestamp:
09/03/10 10:01:17 (1 year ago)
Author:
dmitrey
Message:

fix for FD pow attached constraints + minor code cleanup

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • PythonPackages/FuncDesigner/FuncDesigner/examples/ooSysMinimizeLP.py

    r688 r736  
    1414    S &= b+i*c > 10*i + sum(a) 
    1515 
    16 r = S.minimize(f, startPoint, solver='glpk')  
     16w = oovar() 
     17S &= a+sin(w) < 100 
     18startPoint[w] = 1 
     19 
     20r = S.minimize(f+cos(w), startPoint, fixedVars=w)  
    1721# you could use S.maximize as well 
    1822 
  • PythonPackages/FuncDesigner/FuncDesigner/ooFun.py

    r735 r736  
    314314            input = [self, other] 
    315315        r = oofun(f, input, d = d) 
    316         if isinstance(other, oofun) or (not isinstance(other, int) and (type(other) == ndarray and other.flatten()[0] != int)):  
     316        if isinstance(other, oofun) or (not isinstance(other, int) or (type(other) == ndarray and other.flatten()[0] != int)):  
    317317            r.attach((self>0)('pow_domain_%d'%r._id, tol=-1e-7)) # TODO: if "other" is fixed oofun with integer value - omit this 
    318318        r.isCostly = True 
     
    969969                self._order = inf if any(asarray(orders) != 0) else 0 
    970970 
    971 #                dep = self.getDep() 
    972 #                if (fixedVars is not None and self in fixedVars) or (Vars is not None and dep.isself not in Vars) 
    973                 #self._order = inf 
    974971        return self._order 
    975972