Add vector output for some solvers #175
Open
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
Intervalfor a scalar output or a tuple ofIntervals for a vector output. This PR instead calls_wrap_outputbefore returning the result, which wraps vector outputs in aVector{<:Interval}.Some questions/comments:
Note that, since the result can be a tuple,
encloseis 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
enclosefunction 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_outputin 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
enclosefor scalar outputs and have a new functionenclose_vectorfor vector outputs. This function could simply first callencloseand then_wrap_outputon the result.Some solvers are not supported and probably require to change the algorithm. See the error messages below.
MooreSkelboeEnclosure
MeanValueEnclosure / BranchAndBoundEnclosure