Skip to main content

Module newton

Module newton 

Source
Expand description

Newton refinement of a root a subdivision search has isolated — shared by geop_core_geometry‘s NurbCurve::refine_parameter_at_point and the intersection searches’ refine_crossings — and Newton’s method on one unknown from a seed (newton_1d), for a point that is a free choice up to where a function vanishes.

Subdivision and Newton divide the work. Subdivision is the global method: it reliably finds and separates every solution, and recognizes coincidence even for a partial overlap, but converges only one bit per split — squeezing a parameter down to machine accuracy would take ~50 levels against the ~7 that isolate it. Newton cannot find anything, but polishes an isolated solution quadratically. So the searches subdivide to isolate, and a caller about to use a parameter — as a split point, where NurbCurve::split cannot absorb a min_subdivision_size-wide one (Boehm insertion amplifies its width without bound) — refines it here.

Enums§

Arrive
When newton_1d has arrived.

Traits§

Newton1d
A number newton_1d runs in: plain f64, or a scalar.

Functions§

newton_1d
Newton’s method on one unknown from seed, at most steps steps, within (lo, hi). at(x) gives the function’s value and slope at x. Every iterate is a sharp seed clamped into (lo, hi): what is returned is a point as good as any other where the function vanishes, not an enclosure of the root. seed itself is asked as it is.
refine
Refine start — a box a subdivision search proved holds a root — by Newton, within domain. step takes an iterate to the next one, unsharpened, or None where Newton cannot go on (a singular Jacobian at a tangential crossing or a pole, an evaluation failing).