Trait diffsol::op::NonLinearOp

source ·
pub trait NonLinearOp: Op {
Show 13 methods // Required methods fn call_inplace(&self, x: &Self::V, t: Self::T, y: &mut Self::V); fn jac_mul_inplace( &self, x: &Self::V, t: Self::T, v: &Self::V, y: &mut Self::V ); // Provided methods fn sens_mul_inplace( &self, _x: &Self::V, _t: Self::T, _v: &Self::V, y: &mut Self::V ) { ... } fn has_sens(&self) -> bool { ... } fn call(&self, x: &Self::V, t: Self::T) -> Self::V { ... } fn jac_mul(&self, x: &Self::V, t: Self::T, v: &Self::V) -> Self::V { ... } fn sens_mul(&self, x: &Self::V, t: Self::T, v: &Self::V) -> Self::V { ... } 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 ) { ... } fn jacobian(&self, x: &Self::V, t: Self::T) -> Self::M { ... } fn sens_inplace(&self, x: &Self::V, t: Self::T, y: &mut Self::M) { ... } fn _default_sens_inplace(&self, x: &Self::V, t: Self::T, y: &mut Self::M) { ... } fn sens(&self, x: &Self::V, t: Self::T) -> Self::M { ... }
}

Required Methods§

source

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

Compute the operator F(x, t) at a given state and time.

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 sens_mul_inplace( &self, _x: &Self::V, _t: Self::T, _v: &Self::V, y: &mut Self::V )

Compute the product of the gradient of F wrt a parameter vector p with a given vector J_p(x, t) * v. Note that the vector v is of size nparams() and the result is of size nstates(). Default implementation returns zero and panics if nparams() is not zero.

source

fn has_sens(&self) -> bool

source

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

Compute the operator F(x, t) at a given state and time, and return the result. Use [Self::call_inplace] to for a non-allocating version.

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 sens_mul(&self, x: &Self::V, t: Self::T, v: &Self::V) -> Self::V

Compute the product of the partial gradient of F wrt a parameter vector p with a given vector \parial F/\partial p(x, t) * v, and return the result. Use [Self::sens_mul_inplace] to for a non-allocating version.

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 Op::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).

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 sens_inplace(&self, x: &Self::V, t: Self::T, y: &mut Self::M)

Compute the gradient of the operator wrt a parameter vector p and store it in the matrix y. y should have been previously initialised using the output of Op::sparsity. The default implementation of this method computes the gradient using Self::sens_mul_inplace, but it can be overriden for more efficient implementations.

source

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

Default implementation of the gradient computation (this is the default for Self::sens_inplace).

source

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

Compute the gradient of the operator wrt a parameter vector p and return it. See Self::sens_inplace for a non-allocating version.

Implementations on Foreign Types§

source§

impl<C: NonLinearOp> NonLinearOp for &C

source§

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

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)

Implementors§

source§

impl NonLinearOp for DiffSlRhs<'_>

source§

impl NonLinearOp for DiffSlRoot<'_>

source§

impl<C: NonLinearOp> NonLinearOp for FilterCallable<C>

source§

impl<Eqn> NonLinearOp for SensRhs<Eqn>
where Eqn: OdeEquations,

source§

impl<Eqn: OdeEquations> NonLinearOp for BdfCallable<Eqn>
where for<'b> &'b Eqn::V: VectorRef<Eqn::V>, for<'b> &'b Eqn::M: MatrixRef<Eqn::M>,

source§

impl<Eqn: OdeEquations> NonLinearOp for InitOp<Eqn>

source§

impl<Eqn: OdeEquations> NonLinearOp for SdirkCallable<Eqn>
where for<'b> &'b Eqn::V: VectorRef<Eqn::V>, for<'b> &'b Eqn::M: MatrixRef<Eqn::M>,

source§

impl<M, F> NonLinearOp for ClosureNoJac<M, F>
where M: Matrix, F: Fn(&M::V, &M::V, M::T, &mut M::V),

source§

impl<M, F, G> NonLinearOp for 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> NonLinearOp for 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: Matrix> NonLinearOp for UnitCallable<M>