NonLinearOpJacobian

Trait NonLinearOpJacobian 

Source
pub trait NonLinearOpJacobian: NonLinearOp {
    // Required method
    fn jac_mul_inplace(
        &self,
        x: &Self::V,
        t: Self::T,
        v: &Self::V,
        y: &mut Self::V,
    );

    // Provided methods
    fn jac_mul(&self, x: &Self::V, t: Self::T, v: &Self::V) -> Self::V { ... }
    fn jacobian(&self, x: &Self::V, t: Self::T) -> Self::M { ... }
    fn jacobian_sparsity(&self) -> Option<<Self::M as Matrix>::Sparsity> { ... }
    fn jacobian_inplace(&self, x: &Self::V, t: Self::T, y: &mut Self::M) { ... }
    fn _default_jacobian_inplace(
        &self,
        x: &Self::V,
        t: Self::T,
        y: &mut Self::M,
    ) { ... }
}

Required Methods§

Source

fn jac_mul_inplace(&self, x: &Self::V, t: Self::T, v: &Self::V, y: &mut Self::V)

Compute the product of the Jacobian with a given vector J(x, t) * v.

Provided Methods§

Source

fn jac_mul(&self, x: &Self::V, t: Self::T, v: &Self::V) -> Self::V

Compute the product of the Jacobian with a given vector J(x, t) * v, and return the result. Use [Self::jac_mul_inplace] to for a non-allocating version.

Source

fn jacobian(&self, x: &Self::V, t: Self::T) -> Self::M

Compute the Jacobian matrix J(x, t) of the operator and return it. See Self::jacobian_inplace for a non-allocating version.

Source

fn jacobian_sparsity(&self) -> Option<<Self::M as Matrix>::Sparsity>

Return sparsity information (if available)

Source

fn jacobian_inplace(&self, x: &Self::V, t: Self::T, y: &mut Self::M)

Compute the Jacobian matrix J(x, t) of the operator and store it in the matrix y. y should have been previously initialised using the output of Self::jacobian_sparsity. The default implementation of this method computes the Jacobian using Self::jac_mul_inplace, but it can be overriden for more efficient implementations.

Source

fn _default_jacobian_inplace(&self, x: &Self::V, t: Self::T, y: &mut Self::M)

Default implementation of the Jacobian computation (this is the default for Self::jacobian_inplace).

Implementations on Foreign Types§

Source§

impl<C: NonLinearOpJacobian> NonLinearOpJacobian for &C

Source§

fn jac_mul_inplace(&self, x: &Self::V, t: Self::T, v: &Self::V, y: &mut Self::V)

Source§

fn jacobian_inplace(&self, x: &Self::V, t: Self::T, y: &mut Self::M)

Source§

fn jacobian_sparsity(&self) -> Option<<Self::M as Matrix>::Sparsity>

Implementors§

Source§

impl<'a, Eqn, Method> NonLinearOpJacobian for AdjointOut<'a, Eqn, Method>
where Eqn: OdeEquationsAdjoint, Method: OdeSolverMethod<'a, Eqn>,

Source§

impl<'a, Eqn, Method> NonLinearOpJacobian for AdjointRhs<'a, Eqn, Method>
where Eqn: OdeEquationsAdjoint, Method: OdeSolverMethod<'a, Eqn>,

Source§

impl<Eqn> NonLinearOpJacobian for SensRhs<'_, Eqn>

Source§

impl<Eqn: OdeEquationsImplicit> NonLinearOpJacobian for BdfCallable<Eqn>

Source§

impl<Eqn: OdeEquationsImplicit> NonLinearOpJacobian for InitOp<'_, Eqn>

Source§

impl<Eqn: OdeEquationsImplicit> NonLinearOpJacobian for SdirkCallable<Eqn>

Source§

impl<M, F, G> NonLinearOpJacobian for ParameterisedOp<'_, Closure<M, F, G>>
where M: Matrix, F: Fn(&M::V, &M::V, M::T, &mut M::V), G: Fn(&M::V, &M::V, M::T, &M::V, &mut M::V),

Source§

impl<M, F, G, H> NonLinearOpJacobian for ParameterisedOp<'_, ClosureWithSens<M, F, G, H>>
where M: Matrix, F: Fn(&M::V, &M::V, M::T, &mut M::V), G: Fn(&M::V, &M::V, M::T, &M::V, &mut M::V), H: Fn(&M::V, &M::V, M::T, &M::V, &mut M::V),

Source§

impl<M, F, G, H, I> NonLinearOpJacobian for ParameterisedOp<'_, ClosureWithAdjoint<M, F, G, H, I>>
where M: Matrix, F: Fn(&M::V, &M::V, M::T, &mut M::V), G: Fn(&M::V, &M::V, M::T, &M::V, &mut M::V), H: Fn(&M::V, &M::V, M::T, &M::V, &mut M::V), I: Fn(&M::V, &M::V, M::T, &M::V, &mut M::V),

Source§

impl<M: Matrix> NonLinearOpJacobian for MatrixOp<M>

Source§

impl<M: Matrix> NonLinearOpJacobian for ParameterisedOp<'_, UnitCallable<M>>

Source§

impl<M: Matrix> NonLinearOpJacobian for UnitCallable<M>

Source§

impl<M: MatrixHost<T: DiffSlScalar>, CG: CodegenModule> NonLinearOpJacobian for DiffSlOut<'_, M, CG>

Source§

impl<M: MatrixHost<T: DiffSlScalar>, CG: CodegenModule> NonLinearOpJacobian for DiffSlRhs<'_, M, CG>

Source§

impl<M: MatrixHost<T: DiffSlScalar>, CG: CodegenModule> NonLinearOpJacobian for DiffSlRoot<'_, M, CG>