Changeset 1219

Show
Ignore:
Timestamp:
08/11/08 12:22:26 (3 months ago)
Author:
dmitrey.kroshko
Message:

some changes

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/openopt/scikits/openopt/Kernel/BaseAlg.py

    r1093 r1219  
    11__docformat__ = "restructuredtext en" 
    2 from numpy import atleast_1d,  all, asarray, ndarray, copy 
     2from numpy import atleast_1d,  all, asarray, ndarray, copy, ravel 
    33 
    44class BaseAlg: 
     
    6868        #else: p.Fk = p.objFuncMultiple2Single(fv) 
    6969 
    70         v = atleast_1d(asarray(p.Fk))[0] 
     70        v = ravel(p.Fk)[0] 
    7171        if p.invertObjFunc: v = -v 
    7272 
     
    7474 
    7575        if not rArg: 
    76             p.rk = atleast_1d(p.getMaxResidual(p.xk))[0] 
     76            p.rk = ravel(p.getMaxResidual(p.xk))[0] 
    7777        p.iterValues.r.append(p.rk) 
    7878 
  • trunk/openopt/scikits/openopt/Kernel/Function.py

    r1216 r1219  
    4747                self.input = (self.input, ) 
    4848            for oofunInstance in self.input: 
     49                if not hasattr(oofunInstance, 'x'): 
     50                    oofunInstance.x = self.x 
    4951                tmp = oofunInstance.__getDep__() 
    5052                if tmp is None: 
     
    138140    def __d(self, *args, **kwargs): 
    139141        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 
    141147            # TODO: add args 
    142148        else: 
  • trunk/openopt/scikits/openopt/Kernel/ooIter.py

    r1100 r1219  
    22 
    33from time import time, clock 
    4 from numpy import asfarray, atleast_1d,  isreal,  all,  ndarray 
     4from numpy import isreal,  all 
    55from ooMisc import isSolved 
    66NoneType = type(None)