pub trait DerivativeSolver {
// Required methods
fn config(&self) -> &SolverConfig;
fn refine<G: Function1D>(
&self,
g: &mut G,
accuracy: Real,
state: Solver1DState,
) -> QlResult<Real>;
// Provided methods
fn solve<G: Function1D>(
&self,
g: G,
accuracy: Real,
guess: Real,
step: Real,
) -> QlResult<Real> { ... }
fn solve_bracketed<G: Function1D>(
&self,
g: G,
accuracy: Real,
guess: Real,
x_min: Real,
x_max: Real,
) -> QlResult<Real> { ... }
}Expand description
A 1-D root finder that uses the function’s derivative (Newton and friends).
A separate contract from Solver1D: its refinement needs f', so it takes
a Function1D rather than a bare value closure. It still reuses the shared
bracketing helpers for the auto-bracketing and bracket-validation phases.
Required Methods§
Sourcefn config(&self) -> &SolverConfig
fn config(&self) -> &SolverConfig
The shared configuration (evaluation cap, domain bounds).
Sourcefn refine<G: Function1D>(
&self,
g: &mut G,
accuracy: Real,
state: Solver1DState,
) -> QlResult<Real>
fn refine<G: Function1D>( &self, g: &mut G, accuracy: Real, state: Solver1DState, ) -> QlResult<Real>
Refine an already-bracketed root of g to the given accuracy, with the
bracket invariants documented on Solver1DState guaranteed by the driver
(the derivative-solver analogue of Solver1D::solve_impl).
§Errors
Returns an error if the refinement exhausts the evaluation budget or the method cannot proceed (e.g. a pure Newton step leaves the bracket).
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".