Skip to main content

NewtonRaphson

Struct NewtonRaphson 

Source
pub struct NewtonRaphson {
    pub abs_tol: Tolerances,
    pub error_norm: Norm,
    pub line_search: LineSearch,
    pub max_steps: usize,
    pub rel_tol: Option<Scalar>,
    pub trust_region: TrustRegion,
}
Expand description

The Newton-Raphson method.

Fields§

§abs_tol: Tolerances

Absolute error tolerances.

§error_norm: Norm

Norm type for error evaluation.

§line_search: LineSearch

Line search algorithm.

§max_steps: usize

Maximum number of steps.

§rel_tol: Option<Scalar>

Relative error tolerance.

§trust_region: TrustRegion

How far the step is trusted.

Trait Implementations§

Source§

impl Clone for NewtonRaphson

Source§

fn clone(&self) -> NewtonRaphson

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 Debug for NewtonRaphson

Source§

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

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

impl Default for NewtonRaphson

Source§

fn default() -> Self

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

impl<F, J, X, E> FirstOrderRootFinding<F, J, X> for NewtonRaphson
where F: Jacobian + Erase<Erased = E>, for<'a> &'a F: Div<J, Output = X>, J: Hessian, X: Erase<Erased = E> + Solution, E: Tensor, <X as Tensor>::Unit: UnitDiv<<X as Tensor>::Unit, Output = Dimensionless>, for<'a> &'a X: Mul<Quantity<Dimensionless>, Output = X> + Mul<Scalar, Output = X>, for<'a> &'a Matrix: Mul<&'a X, Output = Vector>,

Source§

fn root( &self, function: impl FnMut(&X) -> Result<F, String>, jacobian: impl FnMut(&X) -> Result<J, String>, initial_guess: X, equality_constraint: EqualityConstraint, sparse: Option<SparseSolver>, ) -> Result<X, OptimizationError>

Source§

impl<U, V, Ru, Rv, Kuu, Kvu, Kuv, Kvv> FirstOrderRootFindingBlock<U, V, Ru, Rv, Kuu, Kvu, Kuv, Kvv> for NewtonRaphson
where U: Solution, V: Solution, Ru: Jacobian, Rv: Jacobian, Kuu: HessianBlock, Kvu: HessianBlock, Kuv: HessianBlock, Kvv: HessianBlock, for<'a> &'a CscMatrix: Mul<&'a U, Output = Vector> + Mul<&'a V, Output = Vector>,

Source§

fn root_block( &self, residual_global: impl FnMut(&U, &V) -> Result<Ru, String>, residual_local: impl FnMut(&U, &V) -> Result<Rv, String>, tangents: impl FnMut(&U, &V) -> Result<(Kuu, Kvu, Kuv, Kvv), String>, initial_guess: (U, V), constraint_global: (CscMatrix, Vector), constraint_local: (CscMatrix, Vector), sparse: Option<SparseSolver>, strategy: SolveStrategy, ) -> Result<(U, V), OptimizationError>

Source§

impl<F, J, X, E> FirstOrderRootFindingIncremental<F, J, X> for NewtonRaphson
where F: Jacobian + Erase<Erased = E>, for<'a> &'a F: Div<J, Output = X>, J: Hessian, X: Erase<Erased = E> + Solution, E: Tensor, <X as Tensor>::Unit: UnitDiv<<X as Tensor>::Unit, Output = Dimensionless>, for<'a> &'a X: Mul<Quantity<Dimensionless>, Output = X> + Mul<Scalar, Output = X>, for<'a> &'a Matrix: Mul<&'a X, Output = Vector>,

Source§

fn root_incremental( &self, function: impl FnMut(&X) -> Result<F, String>, jacobian: impl FnMut(&X) -> Result<J, String>, update: impl FnMut(&X, &Vector, Scalar, bool) -> Result<(), String>, initial_guess: X, equality_constraint: EqualityConstraint, sparse: Option<SparseSolver>, ) -> Result<X, OptimizationError>

Source§

impl<F, J, H, X, E> SecondOrderOptimization<F, J, H, X> for NewtonRaphson
where F: Erase<Erased = Scalar> + Tensor, <J as Tensor>::Unit: UnitMul<<X as Tensor>::Unit>, <<J as Tensor>::Unit as UnitMul<<X as Tensor>::Unit>>::Output: UnitSum, <<<J as Tensor>::Unit as UnitMul<<X as Tensor>::Unit>>::Output as UnitSum>::Output: Is<<F as Tensor>::Unit>, H: Hessian, J: Jacobian + Erase<Erased = E>, for<'a> &'a J: Div<H, Output = X>, X: Erase<Erased = E> + Solution, E: Tensor, <X as Tensor>::Unit: UnitDiv<<X as Tensor>::Unit, Output = Dimensionless>, for<'a> &'a X: Mul<Quantity<Dimensionless>, Output = X> + Mul<Scalar, Output = X>, for<'a> &'a Matrix: Mul<&'a X, Output = Vector>,

Source§

fn minimize( &self, function: impl FnMut(&X) -> Result<F, String>, jacobian: impl FnMut(&X) -> Result<J, String>, hessian: impl FnMut(&X) -> Result<H, String>, initial_guess: X, equality_constraint: EqualityConstraint, sparse: Option<SparseSolver>, ) -> Result<X, OptimizationError>

Source§

impl<F, U, V, Ru, Rv, Kuu, Kvu, Kuv, Kvv> SecondOrderOptimizationBlock<F, U, V, Ru, Rv, Kuu, Kvu, Kuv, Kvv> for NewtonRaphson
where F: Erase<Erased = Scalar> + Tensor, <Ru as Tensor>::Unit: UnitMul<<U as Tensor>::Unit>, <<Ru as Tensor>::Unit as UnitMul<<U as Tensor>::Unit>>::Output: UnitSum, <<<Ru as Tensor>::Unit as UnitMul<<U as Tensor>::Unit>>::Output as UnitSum>::Output: Is<<F as Tensor>::Unit>, <Rv as Tensor>::Unit: UnitMul<<V as Tensor>::Unit>, <<Rv as Tensor>::Unit as UnitMul<<V as Tensor>::Unit>>::Output: UnitSum, <<<Rv as Tensor>::Unit as UnitMul<<V as Tensor>::Unit>>::Output as UnitSum>::Output: Is<<F as Tensor>::Unit>, U: Solution, V: Solution, Ru: Jacobian, Rv: Jacobian, Kuu: HessianBlock, Kvu: HessianBlock, Kuv: HessianBlock, Kvv: HessianBlock, for<'a> &'a CscMatrix: Mul<&'a U, Output = Vector> + Mul<&'a V, Output = Vector>,

Source§

fn minimize_block( &self, function: impl FnMut(&U, &V) -> Result<F, String>, residual_global: impl FnMut(&U, &V) -> Result<Ru, String>, residual_local: impl FnMut(&U, &V) -> Result<Rv, String>, tangents: impl FnMut(&U, &V) -> Result<(Kuu, Kvu, Kuv, Kvv), String>, initial_guess: (U, V), constraint_global: (CscMatrix, Vector), constraint_local: (CscMatrix, Vector), sparse: Option<SparseSolver>, strategy: SolveStrategy, ) -> Result<(U, V), OptimizationError>

Source§

impl<F, J, H, X, E> SecondOrderOptimizationIncremental<F, J, H, X> for NewtonRaphson
where F: Erase<Erased = Scalar> + Tensor, <J as Tensor>::Unit: UnitMul<<X as Tensor>::Unit>, <<J as Tensor>::Unit as UnitMul<<X as Tensor>::Unit>>::Output: UnitSum, <<<J as Tensor>::Unit as UnitMul<<X as Tensor>::Unit>>::Output as UnitSum>::Output: Is<<F as Tensor>::Unit>, H: Hessian, J: Jacobian + Erase<Erased = E>, for<'a> &'a J: Div<H, Output = X>, X: Erase<Erased = E> + Solution, E: Tensor, <X as Tensor>::Unit: UnitDiv<<X as Tensor>::Unit, Output = Dimensionless>, for<'a> &'a X: Mul<Quantity<Dimensionless>, Output = X> + Mul<Scalar, Output = X>, for<'a> &'a Matrix: Mul<&'a X, Output = Vector>,

Source§

fn minimize_incremental( &self, function: impl FnMut(&X) -> Result<F, String>, jacobian: impl FnMut(&X) -> Result<J, String>, hessian: impl FnMut(&X) -> Result<H, String>, update: impl FnMut(&X, &Vector, Scalar, bool) -> Result<(), String>, initial_guess: X, equality_constraint: EqualityConstraint, sparse: Option<SparseSolver>, ) -> Result<X, OptimizationError>

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> Is<T> for T

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.