@@ -317,41 +317,41 @@ def solve(self, **kwargs):
317
317
318
318
dL = al_model .dual_feasibility (self .x )
319
319
PdL = self .project_gradient (self .x , dL )
320
- Pmax_new = np .max (np .abs (PdL ))
321
- convals_new = slack_model .cons (self .x )
320
+ Pmax = np .max (np .abs (PdL ))
321
+ convals = slack_model .cons (self .x )
322
322
323
323
# Specific handling for the case where the original NLP is
324
324
# unconstrained
325
325
if slack_model .m == 0 :
326
- max_cons_new = 0.
326
+ max_cons = 0.
327
327
else :
328
- max_cons_new = np .max (np .abs (convals_new ))
328
+ max_cons = np .max (np .abs (convals ))
329
329
330
330
self .f = self .model .model .model .obj (self .x [:on ])
331
- self .pgnorm = Pmax_new
331
+ self .pgnorm = Pmax
332
332
333
333
# Print out header, say, every 20 iterations.
334
334
if self .iter % 20 == 0 :
335
335
self .log .info (self .header )
336
336
337
337
self .log .info (self .format % (self .iter , self .f ,
338
- self .pgnorm , max_cons_new ,
338
+ self .pgnorm , max_cons ,
339
339
al_model .penalty ,
340
340
bc_solver .iter , bc_solver .status ,
341
341
self .omega , self .eta ))
342
342
343
343
# Update penalty parameter or multipliers based on result
344
- if max_cons_new <= np .maximum (self .eta , self .eta_opt ):
344
+ if max_cons <= np .maximum (self .eta , self .eta_opt ):
345
345
346
346
# Update convergence check
347
- if max_cons_new <= self .eta_opt and Pmax_new <= self .omega_opt :
347
+ if max_cons <= self .eta_opt and Pmax <= self .omega_opt :
348
348
exitOptimal = True
349
349
break
350
350
351
- self .update_multipliers (convals_new , bc_solver .status )
351
+ self .update_multipliers (convals , bc_solver .status )
352
352
353
353
# Update reference constraint norm on successful reduction
354
- cons_norm_ref = max_cons_new
354
+ cons_norm_ref = max_cons
355
355
infeas_iter = 0
356
356
357
357
# If optimality of the inner loop is not achieved within 10
@@ -368,10 +368,10 @@ def solve(self, **kwargs):
368
368
self .update_penalty_parameter ()
369
369
self .log .debug ("keeping current multipliers estimates" )
370
370
371
- if max_cons_new > 0.99 * cons_norm_ref and self .iter != 1 :
371
+ if max_cons > 0.99 * cons_norm_ref and self .iter != 1 :
372
372
infeas_iter += 1
373
373
else :
374
- cons_norm_ref = max_cons_new
374
+ cons_norm_ref = max_cons
375
375
infeas_iter = 0
376
376
377
377
if infeas_iter == 10 :
@@ -413,4 +413,4 @@ def solve(self, **kwargs):
413
413
self .log .info ("f = %12.8g" % self .f )
414
414
if slack_model .m != 0 :
415
415
self .log .info ("pi_max = %12.8g" % np .max (al_model .pi ))
416
- self .log .info ("max infeas. = %12.8g" % max_cons_new )
416
+ self .log .info ("max infeas. = %12.8g" % max_cons )
0 commit comments