Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add vector output for some solvers #175

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

schillic
Copy link
Member

So far, the result was either an Interval for a scalar output or a tuple of Intervals for a vector output. This PR instead calls _wrap_output before returning the result, which wraps vector outputs in an IntervalBox.

Some questions/comments:

  1. Note that, since the result can be a tuple, enclose is not type stable in master. I wonder whether we should add another dispatch argument to determine whether the function has one or several outputs to get type stability (maybe vector_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).

  2. It is unfortunate that we exposed the enclose function to the user and not some other function like register_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.)

  1. To partially address 1. and 2., we could reserve enclose for scalar outputs and have a new function enclose_vector for vector outputs. This function could simply first call enclose and then _wrap_output on the result.

  2. Some solvers are not supported and probably require to change the algorithm. See the error messages below.

MooreSkelboeEnclosure

ERROR: MethodError: no method matching sup(::Tuple{Interval{Float64}, Interval{Float64}})

MeanValueEnclosure / BranchAndBoundEnclosure

ERROR: MethodError: no method matching extract_derivative(::Type{ForwardDiff.Tag{…}}, ::Tuple{ForwardDiff.Dual{…}, ForwardDiff.Dual{…}})

@schillic schillic marked this pull request as ready for review March 24, 2024 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant