Skip to main content

Ridder

Struct Ridder 

Source
pub struct Ridder { /* private fields */ }
Expand description

Ridder’s method root finder.

Implementations§

Source§

impl Ridder

Source

pub fn new() -> Self

A Ridder solver with the default configuration.

Source

pub fn with_max_evaluations(self, evaluations: usize) -> Self

Set the evaluation cap (builder form).

Source

pub fn with_lower_bound(self, lower_bound: Real) -> Self

Restrict the search to x >= lower_bound (builder form).

Source

pub fn with_upper_bound(self, upper_bound: Real) -> Self

Restrict the search to x <= upper_bound (builder form).

Trait Implementations§

Source§

impl Clone for Ridder

Source§

fn clone(&self) -> Ridder

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Ridder

Source§

impl Debug for Ridder

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Ridder

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Solver1D for Ridder

Source§

fn config(&self) -> &SolverConfig

The shared configuration (evaluation cap, domain bounds).
Source§

fn config_mut(&mut self) -> &mut SolverConfig

Mutable access to the shared configuration.
Source§

fn solve_impl<F>( &mut self, f: &mut F, x_acc: Real, st: &mut Solver1DState, ) -> QlResult<Real>
where F: FnMut(Real) -> Real,

Refine the already-bracketed root of f (invariants per Solver1DState) to the given accuracy. f is FnMut because QuantLib functors may carry mutable state (e.g. recording the last argument). Read more
Source§

fn max_evaluations(&self) -> usize

The evaluation cap for the bracketing search and the refinement step.
Source§

fn set_max_evaluations(&mut self, evaluations: usize)

Set the evaluation cap.
Source§

fn set_lower_bound(&mut self, lower_bound: Real)

Restrict the search to x >= lower_bound (QuantLib’s setLowerBound).
Source§

fn set_upper_bound(&mut self, upper_bound: Real)

Restrict the search to x <= upper_bound (QuantLib’s setUpperBound).
Source§

fn solve<F>( &mut self, f: F, accuracy: Real, guess: Real, step: Real, ) -> QlResult<Real>
where F: FnMut(Real) -> Real,

Find a zero of f near guess, auto-bracketing by scanning outward in steps of step. Read more
Source§

fn solve_bracketed<F>( &mut self, f: F, accuracy: Real, guess: Real, x_min: Real, x_max: Real, ) -> QlResult<Real>
where F: FnMut(Real) -> Real,

Find a zero of f in the caller-supplied bracket [x_min, x_max], with guess as the starting point. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.