Expand description
Structure for Root finding
Implementations
sourceimpl<F: Fn(AD) -> AD> RootFinder<F>
impl<F: Fn(AD) -> AD> RootFinder<F>
sourcepub fn new(init: RootState, method: RootFind, f: F) -> Result<Self, RootError>
pub fn new(init: RootState, method: RootFind, f: F) -> Result<Self, RootError>
Create RootFinder
Default Options
- Times: 100
- Tolerance: 1e-10
Usage
extern crate peroxide;
use peroxide::fuga::*;
fn main() -> Result<(), RootError> {
let init = RootState::I(1f64, 3f64);
let mut a = RootFinder::new(init, Bisection, f)?;
let x = a.find_root()?;
x.print();
Ok(())
}
fn f(x: AD) -> AD {
x.powi(2) - 4f64
}
pub fn f(&self, x: AD) -> AD
sourcepub fn condition_number(&self) -> f64
pub fn condition_number(&self) -> f64
Condition number
sourcepub fn get_method(&self) -> RootFind
pub fn get_method(&self) -> RootFind
Get method
sourcepub fn check_find(&self) -> RootBool
pub fn check_find(&self) -> RootBool
Check if find root
Trait Implementations
sourceimpl<F: Clone + Fn(AD) -> AD> Clone for RootFinder<F>
impl<F: Clone + Fn(AD) -> AD> Clone for RootFinder<F>
sourcefn clone(&self) -> RootFinder<F>
fn clone(&self) -> RootFinder<F>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl<F> RefUnwindSafe for RootFinder<F> where
F: RefUnwindSafe,
impl<F> Send for RootFinder<F> where
F: Send,
impl<F> Sync for RootFinder<F> where
F: Sync,
impl<F> Unpin for RootFinder<F>
impl<F> UnwindSafe for RootFinder<F> where
F: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more