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.
So far, the result was either an
Interval
for a scalar output or a tuple ofInterval
s for a vector output. This PR instead calls_wrap_output
before returning the result, which wraps vector outputs in anIntervalBox
.Some questions/comments:
Note that, since the result can be a tuple,
enclose
is not type stable inmaster
. I wonder whether we should add another dispatch argument to determine whether the function has one or several outputs to get type stability (maybevector_output::Val{true/false}
). If not passed, the value could be determined by executing the function for the center of the domain (this is of course not type stable).It is unfortunate that we exposed the
enclose
function to the user and not some other function likeregister_enclose
¹ because then I could have just modified the code in one central place. Now I had to manually add_wrap_output
in every relevant place, and if a user wants to add another solver, they have to do the same.¹(We originally actually had
_enclose
, but then we were advised to not do that and then probably forgot the reason we did this.)To partially address 1. and 2., we could reserve
enclose
for scalar outputs and have a new functionenclose_vector
for vector outputs. This function could simply first callenclose
and then_wrap_output
on the result.Some solvers are not supported and probably require to change the algorithm. See the error messages below.
MooreSkelboeEnclosure
MeanValueEnclosure / BranchAndBoundEnclosure