pub struct KrawczykSolver { /* private fields */ }Expand description
A simple Krawczyk-method interval root solver.
Given a function f and its derivative df, approximates a root using
the Krawczyk operator K(x, X) = m - f(m)/df(X).
Implementations§
Source§impl KrawczykSolver
impl KrawczykSolver
Sourcepub fn new(max_iters: usize, tolerance: f64) -> Self
pub fn new(max_iters: usize, tolerance: f64) -> Self
Create a new solver with given maximum iterations and tolerance.
Sourcepub fn solve<F, DF>(
&self,
x: FloatInterval,
f: F,
df: DF,
) -> Option<FloatInterval>
pub fn solve<F, DF>( &self, x: FloatInterval, f: F, df: DF, ) -> Option<FloatInterval>
Attempt to find a root of f in x0 using the Krawczyk operator.
f and df take the midpoint as a Float and the interval for the derivative.
Returns the tightest enclosing interval if converged, otherwise None.
Auto Trait Implementations§
impl Freeze for KrawczykSolver
impl RefUnwindSafe for KrawczykSolver
impl Send for KrawczykSolver
impl Sync for KrawczykSolver
impl Unpin for KrawczykSolver
impl UnsafeUnpin for KrawczykSolver
impl UnwindSafe for KrawczykSolver
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more