8000 Changed least-squares multiplier update to compute the change in · PythonOptimizers/NLP.py@b74b153 · GitHub
[go: up one dir, main page]

Skip to content

Commit b74b153

Browse files
Andrew Lambedpo
authored andcommitted
Changed least-squares multiplier update to compute the change in
the multipliers using LSQR, instead of the multipliers themselves.
1 parent 4c2fc2d commit b74b153

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

nlp/optimize/auglag.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,12 +182,12 @@ def least_squares_multipliers(self, x):
182182
Jred = ReducedJacobian(J, np.arange(m, dtype=np.int),
183183
free_vars)
184184

185-
g = slack_model.grad(x)
185+
g = slack_model.grad(x) - J.T * al_model.pi
186186

187187
lsqr = LSQRSolver(Jred.T)
188188
lsqr.solve(g[free_vars], itnlim=lim)
189189
if lsqr.optimal:
190-
al_model.pi = lsqr.x.copy()
190+
al_model.pi += lsqr.x.copy()
191191
else:
192192
self.log.debug("lsqr failed to converge")
193193
return

0 commit comments

Comments
 (0)
0