Skip to content

Commit

Permalink
Ignore box constraints for quadratic models when far away
Browse files Browse the repository at this point in the history
  • Loading branch information
lindonroberts committed Dec 4, 2019
1 parent d404e33 commit 391db36
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion trustregion/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,12 @@ def solve(g, H, delta, sl=None, su=None, verbose_output=False):
s, crvmin = trsapp_interface(g, H, delta)
else:
# Quadratic with box constraints - TRSBOX
s, _, crvmin = trsbox_interface(g, H, sl, su, delta)
trs_inside_box = np.max(sl) <= -delta and np.min(su) >= delta
if trs_inside_box:
# No way the box constraints can be active, so ignore
s, crvmin = trsapp_interface(g, H, delta)
else:
s, _, crvmin = trsbox_interface(g, H, sl, su, delta)
# Ensure box constraints are exactly satisfied (in case of small rounding errors)
if box_constrained:
s = np.minimum(np.maximum(sl, s), su)
Expand Down

0 comments on commit 391db36

Please sign in to comment.