JuliaIntervals / ValidatedNumerics.jl

Rigorous floating-point calculations with interval arithmetic in Julia
Other
85 stars 17 forks source link

Simplify interface for `find_roots` #34

Open dpsanders opened 9 years ago

dpsanders commented 9 years ago

Currently, find_roots is just a thin interface wrapping newton, and returns a slightly complicated structure, namely an array of Root objects, which are tuples of the Interval containing the root and a symbol saying if the root is :unique or :unknown.

I would like find_roots (or a similar simple name) to be an interface for someone who wants to use ValidatedNumerics as a black box, so that they should not need to know anything about intervals.

Currently, in the midpoint_radius branch, there is find_roots_midpoint that returns three arrays: the midpoints, the radii, and the symbols. This can be used with no knowledge of Interval.

My proposal is to rename find_roots_radius to find_roots and assume that a user familiar with interval arithmetic will be happy using the interface directly via newton or krawczyk and dealing with the resulting intervals.

cc @lbenet

lbenet commented 9 years ago

What about simply including some conversion functions? That is, find_roots returns an array of Roots, and through some functions (e.g., interval_to_midpoint) does the rest of the work. The name is a simple suggestion, not more than that...

lbenet commented 9 years ago

My previous comment is related to the ideas behind #35