pub struct RootFdfSolver<'a> { /* private fields */ }
Expand description
This is a workspace for finding roots using methods which do require derivatives.
Implementations
sourceimpl<'a> RootFdfSolver<'a>
impl<'a> RootFdfSolver<'a>
sourcepub fn new(t: RootFdfSolverType) -> Option<RootFdfSolver<'a>>
pub fn new(t: RootFdfSolverType) -> Option<RootFdfSolver<'a>>
This function returns a pointer to a newly allocated instance of a derivative-based solver of type T.
If there is insufficient memory to create the solver then the function returns a null
pointer and the error handler is invoked with an error code of Value::NoMemory
.
sourcepub fn set<F: Fn(f64) -> f64 + 'a, DF: Fn(f64) -> f64 + 'a, FDF: Fn(f64, &mut f64, &mut f64) + 'a>(
&mut self,
f: F,
df: DF,
fdf: FDF,
root: f64
) -> Value
pub fn set<F: Fn(f64) -> f64 + 'a, DF: Fn(f64) -> f64 + 'a, FDF: Fn(f64, &mut f64, &mut f64) + 'a>(
&mut self,
f: F,
df: DF,
fdf: FDF,
root: f64
) -> Value
This function initializes, or reinitializes, an existing solver s to use the function and derivative fdf and the initial guess root.
sourcepub fn iterate(&mut self) -> Value
pub fn iterate(&mut self) -> Value
The following function drives the iteration of each algorithm. Each function performs one iteration to update the state of any solver of the corresponding type. The same func- tion works for all solvers so that different methods can be substituted at runtime without modifications to the code.
This function performs a single iteration of the solver s. If the iteration encounters an unexpected problem then an error code will be returned.
The solver maintains a current best estimate of the root at all times. The bracketing solvers also keep track of the current best interval bounding the root.
Trait Implementations
Auto Trait Implementations
impl<'a> !RefUnwindSafe for RootFdfSolver<'a>
impl<'a> !Send for RootFdfSolver<'a>
impl<'a> !Sync for RootFdfSolver<'a>
impl<'a> Unpin for RootFdfSolver<'a>
impl<'a> !UnwindSafe for RootFdfSolver<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more