Changeset 1219
- Timestamp:
- 08/11/08 12:22:26 (3 months ago)
- Files:
-
- trunk/openopt/scikits/openopt/Kernel/BaseAlg.py (modified) (3 diffs)
- trunk/openopt/scikits/openopt/Kernel/Function.py (modified) (2 diffs)
- trunk/openopt/scikits/openopt/Kernel/ooIter.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/openopt/scikits/openopt/Kernel/BaseAlg.py
r1093 r1219 1 1 __docformat__ = "restructuredtext en" 2 from numpy import atleast_1d, all, asarray, ndarray, copy 2 from numpy import atleast_1d, all, asarray, ndarray, copy, ravel 3 3 4 4 class BaseAlg: … … 68 68 #else: p.Fk = p.objFuncMultiple2Single(fv) 69 69 70 v = atleast_1d(asarray(p.Fk))[0]70 v = ravel(p.Fk)[0] 71 71 if p.invertObjFunc: v = -v 72 72 … … 74 74 75 75 if not rArg: 76 p.rk = atleast_1d(p.getMaxResidual(p.xk))[0]76 p.rk = ravel(p.getMaxResidual(p.xk))[0] 77 77 p.iterValues.r.append(p.rk) 78 78 trunk/openopt/scikits/openopt/Kernel/Function.py
r1216 r1219 47 47 self.input = (self.input, ) 48 48 for oofunInstance in self.input: 49 if not hasattr(oofunInstance, 'x'): 50 oofunInstance.x = self.x 49 51 tmp = oofunInstance.__getDep__() 50 52 if tmp is None: … … 138 140 def __d(self, *args, **kwargs): 139 141 if hasattr(self, 'd'): 140 r = asfarray(self.d(*args, **kwargs)) 142 if self.input is None: 143 r = asfarray(self.d(*args, **kwargs)) 144 else: 145 raise OpenOptException('derivatives for obj-funcs are not implemented yet') 146 141 147 # TODO: add args 142 148 else: trunk/openopt/scikits/openopt/Kernel/ooIter.py
r1100 r1219 2 2 3 3 from time import time, clock 4 from numpy import asfarray, atleast_1d, isreal, all, ndarray4 from numpy import isreal, all 5 5 from ooMisc import isSolved 6 6 NoneType = type(None)
