pub struct RootFinderBuilder<'a> { /* private fields */ }
Expand description
Builder pattern for RootFinder configuration.
Implementations§
Source§impl<'a> RootFinderBuilder<'a>
impl<'a> RootFinderBuilder<'a>
Sourcepub fn new(method: RootFindingMethod) -> Self
pub fn new(method: RootFindingMethod) -> Self
Creates a new instance of RootFinderBuilder
.
Sourcepub fn initial_guess(self, guess: f64) -> Self
pub fn initial_guess(self, guess: f64) -> Self
Sets the initial guess for methods that require one (e.g., Newton-Raphson).
Sourcepub fn boundaries(self, x0: f64, x1: f64) -> Self
pub fn boundaries(self, x0: f64, x1: f64) -> Self
Sets the boundaries for methods that require bounded intervals (e.g., Bisection).
Sourcepub fn max_iterations(self, max: usize) -> Self
pub fn max_iterations(self, max: usize) -> Self
Sets the maximum number of iterations.
Sourcepub fn log_convergence(self, log: bool) -> Self
pub fn log_convergence(self, log: bool) -> Self
Enables or disables logging of convergence steps.
Sourcepub fn function(self, function: &'a dyn Fn(f64) -> f64) -> Self
pub fn function(self, function: &'a dyn Fn(f64) -> f64) -> Self
Sets the target function to be used by the root finder.
Sourcepub fn derivative(self, derivative: &'a dyn Fn(f64) -> f64) -> Self
pub fn derivative(self, derivative: &'a dyn Fn(f64) -> f64) -> Self
Sets the derivative of the target function (required for Newton-Raphson).
Sourcepub fn build(self) -> Result<RootFindingIterationDecorator<'a>, String>
pub fn build(self) -> Result<RootFindingIterationDecorator<'a>, String>
Builds and returns the RootFinder
instance.
Auto Trait Implementations§
impl<'a> Freeze for RootFinderBuilder<'a>
impl<'a> !RefUnwindSafe for RootFinderBuilder<'a>
impl<'a> !Send for RootFinderBuilder<'a>
impl<'a> !Sync for RootFinderBuilder<'a>
impl<'a> Unpin for RootFinderBuilder<'a>
impl<'a> !UnwindSafe for RootFinderBuilder<'a>
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