IntervalRootFinding.jl icon indicating copy to clipboard operation
IntervalRootFinding.jl copied to clipboard

Allow to unpack roots objects

Open Kolaru opened this issue 2 years ago • 0 comments

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

Kolaru avatar Nov 30 '21 23:11 Kolaru