Repository navigation
Keep BOBYQA and COBYLA unscaled coordinates within original bounds - #648
Open
CAOShurong wants to merge 3 commits into
Open
CAOShurong wants to merge 3 commits into
CAOShurong wants to merge 3 commits into
Conversation
jschueller
reviewed
Oct 16, 2026
jschueller
approved these changes
Oct 16, 2026
Owner
|
This looks good, but I would rather change the |
Contributor
Author
|
Moved bounds snapping into |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #625.
Unscaling BOBYQA coordinates can round a point outside the original bounds, including points passed to the objective. Reusing a returned point can then fail with
INVALID_ARGS. COBYLA callbacks can encounter the same roundoff.Move bounds snapping into
nlopt_unscaleand use it for BOBYQA and COBYLA callbacks and returned coordinates. BOBYQA still leaves the input untouched when scaling is rejected before transformation.C regressions cover lower and upper bounds, default/equal/unequal/negative steps, returned-point reuse, and COBYLA objective and constraint callbacks.
Verified on Windows/MSVC: 110 CTest tests, 80 C-only AddressSanitizer tests, installed C/C++/Python interfaces, 216 BOBYQA configurations with unchanged results and callback traces, and 24 COBYLA configurations. The new COBYLA regression fails 12 cases against the previous library and passes all 24 with this change.