Skip to main content

Newton1d

Trait Newton1d 

Source
pub trait Newton1d:
    Iterate
    + Copy
    + Debug {
    // Required methods
    fn could_be_zero(self) -> bool;
    fn step(value: Self, slope: Self) -> GeopResult<(Self, f64)>;
    fn settle(self, step: Self, lo: Self, hi: Self) -> Self;
}
Expand description

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

Required Methods§

Source

fn could_be_zero(self) -> bool

Whether self, a function’s value, could be zero.

Source

fn step(value: Self, slope: Self) -> GeopResult<(Self, f64)>

The Newton step value / slope and its size, or why there is none.

Source

fn settle(self, step: Self, lo: Self, hi: Self) -> Self

self - step, as the seed of the next step: clamped into (lo, hi), and sharp — it is a free choice.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Newton1d for f64

Source§

fn could_be_zero(self) -> bool

Source§

fn step(value: Self, slope: Self) -> GeopResult<(Self, f64)>

Source§

fn settle(self, step: Self, lo: Self, hi: Self) -> Self

Implementors§

Source§

impl Newton1d for Scalar

Sharpened before clamping: clamped’s comparisons are exact on a sharp value, so the seed stays in the domain.