Trait peroxide::numerical::root::RootFinder

source ·
pub trait RootFinder<const I: usize, const O: usize, T> {
    // Required methods
    fn max_iter(&self) -> usize;
    fn tol(&self) -> f64;
    fn find<P: RootFindingProblem<I, O, T>>(&self, problem: &P) -> Result<Pt<I>>;
}
Expand description

Trait to define a root finder

§Type Parameters

  • I: Input type (e.g. f64, [f64; N], or etc.)
  • O: Output type (e.g. f64, [f64; N], or etc.)
  • T: State type (e.g. f64, (f64, f64), or etc.)

§Methods

  • max_iter: Maximum number of iterations
  • tol: Absolute tolerance
  • find: Find root

§Available root finders

  • BisectionMethod: I=1, O=1, T=(f64, f64)
  • FalsePositionMethod: I=1, O=1, T=(f64, f64)
  • NewtonMethod: I=1, O=1, T=f64
  • SecantMethod: I=1, O=1, T=(f64, f64)

Required Methods§

source

fn max_iter(&self) -> usize

source

fn tol(&self) -> f64

source

fn find<P: RootFindingProblem<I, O, T>>(&self, problem: &P) -> Result<Pt<I>>

Object Safety§

This trait is not object safe.

Implementors§

source§

impl RootFinder<1, 1, (f64, f64)> for BisectionMethod

source§

impl RootFinder<1, 1, (f64, f64)> for FalsePositionMethod

source§

impl RootFinder<1, 1, (f64, f64)> for SecantMethod

source§

impl RootFinder<1, 1, f64> for NewtonMethod

source§

impl<const I: usize, const O: usize> RootFinder<I, O, ([f64; I], [f64; I])> for BroydenMethod