Changeset 736
- Timestamp:
- 09/03/10 10:01:17 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
PythonPackages/FuncDesigner/FuncDesigner/examples/ooSysMinimizeLP.py
r688 r736 14 14 S &= b+i*c > 10*i + sum(a) 15 15 16 r = S.minimize(f, startPoint, solver='glpk') 16 w = oovar() 17 S &= a+sin(w) < 100 18 startPoint[w] = 1 19 20 r = S.minimize(f+cos(w), startPoint, fixedVars=w) 17 21 # you could use S.maximize as well 18 22 PythonPackages/FuncDesigner/FuncDesigner/ooFun.py
r735 r736 314 314 input = [self, other] 315 315 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)): 317 317 r.attach((self>0)('pow_domain_%d'%r._id, tol=-1e-7)) # TODO: if "other" is fixed oofun with integer value - omit this 318 318 r.isCostly = True … … 969 969 self._order = inf if any(asarray(orders) != 0) else 0 970 970 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 = inf974 971 return self._order 975 972
