[−][src]Struct peroxide::numerical::root::RootFinder
Structure for Root finding
- Caution:
T
$\geq$AD1
Fields
curr: RootState
Implementations
impl<F: Fn(T) -> T, T: AD> RootFinder<F, T>
[src]
pub fn new(init: RootState, method: RootFind, f: F) -> Result<Self, RootError>
[src]
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::<_, AD1>::new(init, Bisection, f)?; let x = a.find_root()?; x.print(); Ok(()) } fn f<T: AD>(x: T) -> T { x.powi(2) - 4f64 }
pub fn f(&self, x: T) -> T
[src]
pub fn condition_number(&self) -> f64
[src]
Condition number
pub fn set_times(&mut self, times: usize) -> &mut Self
[src]
Set max iteration times
pub fn set_tol(&mut self, tol: f64) -> &mut Self
[src]
Set tolerance
pub fn update(&mut self)
[src]
Update RootFinder
pub fn find_root(&mut self) -> Result<f64, RootError>
[src]
Find Root
Trait Implementations
impl<F: Clone + Fn(T) -> T, T: Clone + AD> Clone for RootFinder<F, T>
[src]
fn clone(&self) -> RootFinder<F, T>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<F: Debug + Fn(T) -> T, T: Debug + AD> Debug for RootFinder<F, T>
[src]
Auto Trait Implementations
impl<F, T> RefUnwindSafe for RootFinder<F, T> where
F: RefUnwindSafe,
T: RefUnwindSafe,
F: RefUnwindSafe,
T: RefUnwindSafe,
impl<F, T> Send for RootFinder<F, T> where
F: Send,
T: Send,
F: Send,
T: Send,
impl<F, T> Sync for RootFinder<F, T> where
F: Sync,
T: Sync,
F: Sync,
T: Sync,
impl<F, T> Unpin for RootFinder<F, T> where
T: Unpin,
T: Unpin,
impl<F, T> UnwindSafe for RootFinder<F, T> where
F: UnwindSafe,
T: UnwindSafe,
F: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,