Changeset 916

Show
Ignore:
Timestamp:
03/22/08 07:07:53 (8 months ago)
Author:
dmitrey.kroshko
Message:

minor bugfix related to badly-scaled problems

Files:

Legend:

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

    r841 r916  
    1818        if type(x) != ndarray: x = asfarray(x) 
    1919         
    20         if hasattr(p, 'xPrevF') and all(x == p.xPrevF) and ind is None and hasattr(p, 'fPrevF'): 
     20        if hasattr(p, 'xPrevF') and all(x.shape == p.xPrevF.shape) and all(x == p.xPrevF) and ind is None and hasattr(p, 'fPrevF'): 
    2121            #TODO: add counter of the situations 
    2222            return copy(p.fPrevF) 
     
    152152     
    153153    def user_c(p, x): 
    154         if hasattr(p, 'xPrevC') and all(x == p.xPrevC): 
     154        if hasattr(p, 'xPrevC') and all(x.shape == p.xPrevC.shape) and all(x == p.xPrevC): 
    155155            return copy(p.cPrevC) 
    156156         
     
    234234     
    235235    def user_h(p, x): 
    236         if hasattr(p, 'xPrevH') and all(x == p.xPrevH): 
     236        if hasattr(p, 'xPrevH') and all(x.shape == p.xPrevH.shape) and all(x == p.xPrevH): 
    237237            return copy(p.hPrevH) 
    238238