pub struct RootResult<T: Float> {
pub root: T,
pub f_root: T,
pub iterations: usize,
pub converged: bool,
}Expand description
Result of a root-finding algorithm.
§Examples
let result = bisection(|x: f64| x * x - 2.0, 1.0, 2.0, &RootOptions::default()).unwrap();
assert!(result.converged);
assert!((result.root - std::f64::consts::SQRT_2).abs() < 1e-10);Fields§
§root: TThe estimated root.
f_root: TThe function value at the root: f(root).
iterations: usizeNumber of iterations performed.
converged: boolWhether the algorithm converged within tolerances.
Trait Implementations§
Source§impl<T: Clone + Float> Clone for RootResult<T>
impl<T: Clone + Float> Clone for RootResult<T>
Source§fn clone(&self) -> RootResult<T>
fn clone(&self) -> RootResult<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<T> Freeze for RootResult<T>where
T: Freeze,
impl<T> RefUnwindSafe for RootResult<T>where
T: RefUnwindSafe,
impl<T> Send for RootResult<T>
impl<T> Sync for RootResult<T>
impl<T> Unpin for RootResult<T>where
T: Unpin,
impl<T> UnsafeUnpin for RootResult<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for RootResult<T>where
T: UnwindSafe,
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