pub struct RootOptions<T: Float> {
pub xtol: T,
pub ftol: T,
pub max_iter: usize,
}Expand description
Options controlling root-finding algorithms.
§Examples
let opts = RootOptions {
xtol: 1e-8,
ftol: 1e-8,
max_iter: 50,
};
let result = bisection(|x: f64| x * x - 2.0, 1.0, 2.0, &opts).unwrap();
assert!(result.converged);Fields§
§xtol: TTolerance on the root position.
ftol: TTolerance on the function value.
max_iter: usizeMaximum number of iterations.
Trait Implementations§
Source§impl<T: Clone + Float> Clone for RootOptions<T>
impl<T: Clone + Float> Clone for RootOptions<T>
Source§fn clone(&self) -> RootOptions<T>
fn clone(&self) -> RootOptions<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 RootOptions<T>where
T: Freeze,
impl<T> RefUnwindSafe for RootOptions<T>where
T: RefUnwindSafe,
impl<T> Send for RootOptions<T>
impl<T> Sync for RootOptions<T>
impl<T> Unpin for RootOptions<T>where
T: Unpin,
impl<T> UnsafeUnpin for RootOptions<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for RootOptions<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