Skip to content

Conversation

@schillic
Copy link
Member

@schillic schillic commented Mar 24, 2024

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 a Vector{<:Interval}.

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
@schillic schillic force-pushed the schillic/vector_output branch from 8a83925 to fabc4e5 Compare September 8, 2025 19:17
@schillic schillic force-pushed the schillic/vector_output branch 2 times, most recently from 4bec665 to 7536045 Compare October 1, 2025 21:43
@schillic schillic force-pushed the schillic/vector_output branch from 7536045 to b6fb0c5 Compare October 2, 2025 16:32
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.

2 participants