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

roots cannot handle functions that return intervals #77

Closed
dpsanders opened this issue Jun 2, 2018 · 4 comments · Fixed by #203
Closed

roots cannot handle functions that return intervals #77

dpsanders opened this issue Jun 2, 2018 · 4 comments · Fixed by #203

Comments

@dpsanders
Copy link
Member

dpsanders commented Jun 2, 2018

Also seems to be true of newton1d.

cc @eeshan9815

@Kolaru
Copy link
Collaborator

Kolaru commented Jun 3, 2018

Do you mean something like that ?

julia> g(x::Interval) = x^2 - 2
g (generic function with 1 method)

julia> roots(g, -2..2)
ERROR: MethodError: no method matching g(::ForwardDiff.Dual{ForwardDiff.Tag{#g,IntervalArithmetic.Interval{Float64}},IntervalArithmetic.Interval{Float64},1})

@dpsanders
Copy link
Member Author

I meant something like

julia> g(x) = x..x
g (generic function with 1 method)

julia> roots(g, -2..2)
ERROR: MethodError: no method matching atomic(::Type{IntervalArithmetic.Interval{IntervalArithmetic.Interval{Float64}}}, ::IntervalArithmetic.Interval{Float64})
Closest candidates are:

@Kolaru
Copy link
Collaborator

Kolaru commented Jun 4, 2018

Is there an use case where this makes sense ? If the return value of g is an interval I don't know how g(x) = 0 should be interpreted.

@lbenet
Copy link
Member

lbenet commented Jun 4, 2018

I've read somewhere that such cases occur and are of interest. Yet, in my opinion, we should perhaps document the current limitations and eventually add that functionality.

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 a pull request may close this issue.

3 participants