JuliaIntervals / IntervalRootFinding.jl

Library for finding the roots of a function using interval arithmetic
https://juliaintervals.github.io/IntervalRootFinding.jl/
Other
125 stars 26 forks source link

Allow to unpack roots objects #180

Open Kolaru opened 2 years ago

Kolaru commented 2 years ago

I think it would be nice to be able to unpack root objects as if they were tuples of (interval, status) e.g. have the following to work

julia> r = Root((1..2), :unique)
Root([1, 2], :unique)

julia> x, status = r

One interesting thing is that it would allow to iterate over the vector of Roots return by roots as follow

for (x, status) in roots(f, A)
    # do stuff
end