File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -444,12 +444,16 @@ def _lagrangian_walk_along_constraints(
444444 x_j = sol .x + lmda * dx
445445
446446 # Check feasibility
447- x_j_min = sol .x + lmda_bounds_new [0 ] * dx
448- F_j_min = self .F (x_j_min )
449- dxbar_j_min = lu_solve (luJ , - F_j_min )
450- dxbar_j_min_norm = np .linalg .norm (dxbar_j_min , ord = 2 )
451-
452- if dxbar_j_min_norm > dx_norm or np .linalg .norm (dx , ord = 2 ) < self .eps :
447+ try :
448+ x_j_min = sol .x + lmda_bounds_new [0 ] * dx
449+ F_j_min = self .F (x_j_min )
450+ dxbar_j_min = lu_solve (luJ , - F_j_min )
451+ dxbar_j_min_norm = np .linalg .norm (dxbar_j_min , ord = 2 )
452+
453+ if dxbar_j_min_norm > dx_norm or np .linalg .norm (dx , ord = 2 ) < self .eps :
454+ persistent_bound_violation = True
455+ except Exception :
456+ # For example, if self.F(x_j_min) fails
453457 persistent_bound_violation = True
454458
455459 # Check newly violated inactive constraints
You can’t perform that action at this time.
0 commit comments