Changeset 1061

Show
Ignore:
Timestamp:
06/25/08 00:18:34 (2 months ago)
Author:
dmitrey.kroshko
Message:

bugfix for ralg handling A, Aeq constraints

Files:

Legend:

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

    r1049 r1061  
    109109            elif resType == 'ub': 
    110110                g[ind] += 1 # N * (+1), +1 = dConstr/dx = d(x-ub)/dx 
    111             elif resType == 'A': 
    112                 g += self.A[ind] 
    113             elif resType == 'Aeq': 
     111            elif resType == 'b': 
     112                g += self.p.A[ind] 
     113            elif resType == 'beq': 
    114114                rr = self.p.matmult(self.p.Aeq[ind], self.x)-self.p.beq[ind] 
    115115                if rr < 0:  g -= self.p.Aeq[ind] 
     
    122122                if self.p.h(self.x, ind=ind) < 0:  g -= dh#CHECKME!! 
    123123                else: g += dh#CHECKME!! 
    124         self._dmr, self._dmrName,  self._dmrInd = g, resType, ind 
     124            self._dmr, self._dmrName,  self._dmrInd = g, resType, ind 
    125125        if retAll: 
    126             return copy(self._dmr),  resType,  ind 
     126            return copy(self._dmr),  self._dmrName,  self._dmrInd 
    127127        else: 
    128128            return copy(self._dmr) 
  • trunk/openopt/scikits/openopt/solvers/UkrOpt/ralg_oo.py

    r1052 r1061  
    117117                break 
    118118 
    119             iterPoint, optimIterPoint = newPoint, oldPoint 
     119            iterPoint  = newPoint 
    120120            x = iterPoint.x 
    121121 
     
    140140 
    141141                        if PrevPoint.betterThan(newPoint) or newPoint.f() > PrevPoint.f() or abs(newPoint.f() - iterPoint.f()) < 15 * p.ftol or p.norm(newPoint.x - iterPoint.x) < 15 * p.xtol: 
    142                             iterPoint, optimIterPoint, hs = PrevPoint, p.point(PrevPoint.x), hs_prev 
     142                            iterPoint, hs = PrevPoint, hs_prev 
    143143                            break 
    144144 
     
    146146 
    147147                        ls -= 1 
     148 
    148149                        if itn != 0: 
    149150                            break 
    150151                    iterPoint = PrevPoint 
    151152 
    152             x = iterPoint.x.copy() 
     153            x = newPoint.x.copy() 
    153154 
    154155            if ls <= 0: hs *= q1 
     
    157158            currIterPointIsFeasible = p.isFeas(x) 
    158159 
    159             g2 = self.__getRalgDirection__(iterPoint) 
     160            g2 = self.__getRalgDirection__(newPoint) 
    160161            if prevIterPointIsFeasible == currIterPointIsFeasible == True: 
    161162                g1 = g2 - g 
     
    223224 
    224225            if p.istop: 
     226                if newPoint.betterThan(oldPoint): optimIterPoint = newPoint 
     227                else: optimIterPoint = oldPoint 
    225228                p.iterfcn(optimIterPoint) 
    226229                return