Changeset 1198
- Timestamp:
- 08/05/08 10:39:14 (4 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/openopt/scikits/openopt/solvers/UkrOpt/ralg_oo.py
r1178 r1198 54 54 55 55 g = self.__getRalgDirection__(iterPoint) 56 moveDirection = g 56 57 if not any(g): 57 58 p.istop = SMALL_DF … … 59 60 return 60 61 61 g2 = copy(g)62 63 62 # #pass-by-ref! not copy! 64 63 # if p.isFeas(p.x0): b = B_f … … 73 72 ls1 = 0 74 73 # TODO: is (g^T b)^T better? 75 g2 = self.__economyMult__(b.T, g)74 g2 = self.__economyMult__(b.T, moveDirection) 76 75 if any(g2): g2 /= p.norm(g2) 77 76 g1 = p.matmult(b, g2) … … 113 112 iterPoint = newPoint 114 113 115 if itn != 0: g2 = self.__getRalgDirection__(iterPoint) 114 moveDirection = self.__getRalgDirection__(iterPoint) 115 g2 = moveDirection 116 116 117 117 118 … … 144 145 break 145 146 iterPoint = PrevPoint 147 moveDirection = self.__getRalgDirection__(iterPoint) 146 148 147 149 … … 160 162 """ Set dilation direction """ 161 163 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.') 164 166 #doDilation = False 165 167 … … 198 200 hs = p.norm(prevIterPoint.x - iterPoint.x) 199 201 200 cond_same_point = all(iterPoint.x == p.xk)201 202 202 203 203 """ Call OO iterfcn """ 204 204 205 if iterPoint.isFeas(): 205 206 if hasattr(iterPoint, '_df'): 206 207 p._df = iterPoint._df 207 208 #print 'has _df' 208 else:209 pass209 #else: 210 #pass 210 211 #print "hasn't _df" 211 212 #p._df = iterPoint._df … … 215 216 """ Check stop criteria """ 216 217 218 cond_same_point = all(iterPoint.x == prevIterPoint.x) 217 219 if cond_same_point and not p.istop: 218 220 p.istop = SMALL_DELTA_X … … 247 249 248 250 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) 252 256 return 253 257
