Changeset 1198

Show
Ignore:
Timestamp:
08/05/08 10:39:14 (4 months ago)
Author:
dmitrey.kroshko
Message:

major changes for ralg

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/openopt/scikits/openopt/solvers/UkrOpt/ralg_oo.py

    r1178 r1198  
    5454 
    5555        g = self.__getRalgDirection__(iterPoint) 
     56        moveDirection = g 
    5657        if not any(g): 
    5758            p.istop = SMALL_DF 
     
    5960            return 
    6061 
    61         g2 = copy(g) 
    62  
    6362#        #pass-by-ref! not copy! 
    6463#        if p.isFeas(p.x0): b = B_f 
     
    7372            ls1 = 0 
    7473            # TODO: is (g^T b)^T better? 
    75             g2 = self.__economyMult__(b.T, g
     74            g2 = self.__economyMult__(b.T, moveDirection
    7675            if any(g2): g2 /= p.norm(g2) 
    7776            g1 = p.matmult(b, g2) 
     
    113112            iterPoint  = newPoint 
    114113 
    115             if itn != 0: g2 = self.__getRalgDirection__(iterPoint) 
     114            moveDirection = self.__getRalgDirection__(iterPoint) 
     115            g2 = moveDirection 
     116 
    116117 
    117118 
     
    144145                        break 
    145146                iterPoint = PrevPoint 
     147                moveDirection = self.__getRalgDirection__(iterPoint) 
    146148 
    147149 
     
    160162            """                         Set dilation direction                            """ 
    161163 
    162             if sum(p.dotmult(g, g2))>0: 
    163                 p.debugmsg('ralg warning: slope angle less than pi/2. Mb dilation for the iter will be omitted.') 
     164            #if sum(p.dotmult(g, g2))>0: 
     165                #p.debugmsg('ralg warning: slope angle less than pi/2. Mb dilation for the iter will be omitted.') 
    164166                #doDilation = False 
    165167 
     
    198200                hs = p.norm(prevIterPoint.x - iterPoint.x) 
    199201 
    200             cond_same_point = all(iterPoint.x == p.xk) 
    201  
    202202 
    203203            """                               Call OO iterfcn                                """ 
     204 
    204205            if iterPoint.isFeas(): 
    205206                if hasattr(iterPoint, '_df'): 
    206207                    p._df = iterPoint._df 
    207208                    #print 'has _df' 
    208                 else: 
    209                     pass 
     209                #else: 
     210                    #pass 
    210211                    #print "hasn't _df" 
    211212                #p._df = iterPoint._df 
     
    215216            """                             Check stop criteria                           """ 
    216217 
     218            cond_same_point = all(iterPoint.x == prevIterPoint.x) 
    217219            if cond_same_point and not p.istop: 
    218220                p.istop = SMALL_DELTA_X 
     
    247249 
    248250            if p.istop: 
    249                 if newPoint.betterThan(oldPoint): optimIterPoint = newPoint 
    250                 else: optimIterPoint = oldPoint 
    251                 p.iterfcn(optimIterPoint) 
     251                if newPoint.betterThan(oldPoint): 
     252                    optimIterPoint = newPoint 
     253                else: 
     254                    optimIterPoint = oldPoint 
     255                if any(optimIterPoint.x != iterPoint.x): p.iterfcn(optimIterPoint) 
    252256                return 
    253257