Skip to main content

Op

Trait Op 

Source
pub trait Op {
    type T: Scalar;
    type V: Vector<T = Self::T, C = Self::C>;
    type M: Matrix<T = Self::T, V = Self::V, C = Self::C>;
    type C: Context;

    // Required methods
    fn context(&self) -> &Self::C;
    fn nstates(&self) -> usize;
    fn nout(&self) -> usize;
    fn nparams(&self) -> usize;

    // Provided method
    fn statistics(&self) -> OpStatistics { ... }
}
Expand description

A generic operator trait.

Op is a trait for operators that, given a paramter vector p, operates on an input vector x to produce an output vector y. It defines the number of states (i.e. length of x), the number of outputs (i.e. length of y), and number of parameters (i.e. length of p) of the operator. It also defines the type of the scalar, vector, and matrices used in the operator.

Required Associated Types§

Source

type T: Scalar

Source

type V: Vector<T = Self::T, C = Self::C>

Source

type M: Matrix<T = Self::T, V = Self::V, C = Self::C>

Source

type C: Context

Required Methods§

Source

fn context(&self) -> &Self::C

return the context of the operator

Source

fn nstates(&self) -> usize

Return the number of input states of the operator.

Source

fn nout(&self) -> usize

Return the number of outputs of the operator.

Source

fn nparams(&self) -> usize

Return the number of parameters of the operator.

Provided Methods§

Source

fn statistics(&self) -> OpStatistics

Return statistics about the operator (e.g. how many times it was called, how many times the jacobian was computed, etc.)

Implementations on Foreign Types§

Source§

impl<C: Op> Op for &C

Source§

type T = <C as Op>::T

Source§

type V = <C as Op>::V

Source§

type M = <C as Op>::M

Source§

type C = <C as Op>::C

Source§

fn nstates(&self) -> usize

Source§

fn nout(&self) -> usize

Source§

fn nparams(&self) -> usize

Source§

fn statistics(&self) -> OpStatistics

Source§

fn context(&self) -> &Self::C

Source§

impl<C: Op> Op for &mut C

Source§

type T = <C as Op>::T

Source§

type V = <C as Op>::V

Source§

type M = <C as Op>::M

Source§

type C = <C as Op>::C

Source§

fn nstates(&self) -> usize

Source§

fn nout(&self) -> usize

Source§

fn nparams(&self) -> usize

Source§

fn statistics(&self) -> OpStatistics

Source§

fn context(&self) -> &Self::C

Implementors§

Source§

impl<'a, Eqn, Method> Op for AdjointEquations<'a, Eqn, Method>
where Eqn: OdeEquations, Method: OdeSolverMethod<'a, Eqn>,

Source§

type T = <Eqn as Op>::T

Source§

type V = <Eqn as Op>::V

Source§

type M = <Eqn as Op>::M

Source§

type C = <Eqn as Op>::C

Source§

impl<'a, Eqn, Method> Op for AdjointInit<'a, Eqn, Method>
where Eqn: OdeEquations, Method: OdeSolverMethod<'a, Eqn>,

Source§

type T = <Eqn as Op>::T

Source§

type V = <Eqn as Op>::V

Source§

type M = <Eqn as Op>::M

Source§

type C = <Eqn as Op>::C

Source§

impl<'a, Eqn, Method> Op for AdjointOut<'a, Eqn, Method>
where Eqn: OdeEquations, Method: OdeSolverMethod<'a, Eqn>,

Source§

type T = <Eqn as Op>::T

Source§

type V = <Eqn as Op>::V

Source§

type M = <Eqn as Op>::M

Source§

type C = <Eqn as Op>::C

Source§

impl<'a, Eqn, Method> Op for AdjointRhs<'a, Eqn, Method>
where Eqn: OdeEquations, Method: OdeSolverMethod<'a, Eqn>,

Source§

type T = <Eqn as Op>::T

Source§

type V = <Eqn as Op>::V

Source§

type M = <Eqn as Op>::M

Source§

type C = <Eqn as Op>::C

Source§

impl<C: NonLinearOpJacobian> Op for LinearisedOp<C>

Source§

type V = <C as Op>::V

Source§

type T = <C as Op>::T

Source§

type M = <C as Op>::M

Source§

type C = <C as Op>::C

Source§

impl<C: Op> Op for ParameterisedOp<'_, C>

Source§

type V = <C as Op>::V

Source§

type T = <C as Op>::T

Source§

type M = <C as Op>::M

Source§

type C = <C as Op>::C

Source§

impl<Eqn> Op for AdjointMass<'_, Eqn>
where Eqn: OdeEquations,

Source§

type T = <Eqn as Op>::T

Source§

type V = <Eqn as Op>::V

Source§

type M = <Eqn as Op>::M

Source§

type C = <Eqn as Op>::C

Source§

impl<Eqn> Op for SensEquations<'_, Eqn>
where Eqn: OdeEquations,

Source§

type T = <Eqn as Op>::T

Source§

type V = <Eqn as Op>::V

Source§

type M = <Eqn as Op>::M

Source§

type C = <Eqn as Op>::C

Source§

impl<Eqn> Op for SensInit<'_, Eqn>
where Eqn: OdeEquations,

Source§

type T = <Eqn as Op>::T

Source§

type V = <Eqn as Op>::V

Source§

type M = <Eqn as Op>::M

Source§

type C = <Eqn as Op>::C

Source§

impl<Eqn> Op for SensRhs<'_, Eqn>
where Eqn: OdeEquations,

Source§

type T = <Eqn as Op>::T

Source§

type V = <Eqn as Op>::V

Source§

type M = <Eqn as Op>::M

Source§

type C = <Eqn as Op>::C

Source§

impl<Eqn> Op for NoAug<Eqn>
where Eqn: OdeEquations,

Source§

type T = <Eqn as Op>::T

Source§

type V = <Eqn as Op>::V

Source§

type M = <Eqn as Op>::M

Source§

type C = <Eqn as Op>::C

Source§

impl<Eqn: OdeEquations> Op for SdirkCallable<Eqn>

Source§

type V = <Eqn as Op>::V

Source§

type T = <Eqn as Op>::T

Source§

type M = <Eqn as Op>::M

Source§

type C = <Eqn as Op>::C

Source§

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

Source§

type V = <Eqn as Op>::V

Source§

type T = <Eqn as Op>::T

Source§

type M = <Eqn as Op>::M

Source§

type C = <Eqn as Op>::C

Source§

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

Source§

type V = <Eqn as Op>::V

Source§

type T = <Eqn as Op>::T

Source§

type M = <Eqn as Op>::M

Source§

type C = <Eqn as Op>::C

Source§

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

Source§

type V = <M as MatrixCommon>::V

Source§

type T = <M as MatrixCommon>::T

Source§

type M = M

Source§

type C = <M as MatrixCommon>::C

Source§

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

Source§

type V = <M as MatrixCommon>::V

Source§

type T = <M as MatrixCommon>::T

Source§

type M = M

Source§

type C = <M as MatrixCommon>::C

Source§

impl<M, F, G> Op 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§

type V = <M as MatrixCommon>::V

Source§

type T = <M as MatrixCommon>::T

Source§

type M = M

Source§

type C = <M as MatrixCommon>::C

Source§

impl<M, F, G> Op for LinearClosureWithAdjoint<M, F, G>
where M: Matrix, F: Fn(&M::V, &M::V, M::T, M::T, &mut M::V), G: Fn(&M::V, &M::V, M::T, M::T, &mut M::V),

Source§

type V = <M as MatrixCommon>::V

Source§

type T = <M as MatrixCommon>::T

Source§

type M = M

Source§

type C = <M as MatrixCommon>::C

Source§

impl<M, F, G, H> Op for ClosureWithSens<M, F, G, H>
where M: Matrix,

Source§

type V = <M as MatrixCommon>::V

Source§

type T = <M as MatrixCommon>::T

Source§

type M = M

Source§

type C = <M as MatrixCommon>::C

Source§

impl<M, F, G, H, I> Op for 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§

type V = <M as MatrixCommon>::V

Source§

type T = <M as MatrixCommon>::T

Source§

type M = M

Source§

type C = <M as MatrixCommon>::C

Source§

impl<M, I> Op for ConstantClosure<M, I>
where M: Matrix, I: Fn(&M::V, M::T, &mut M::V),

Source§

type V = <M as MatrixCommon>::V

Source§

type T = <M as MatrixCommon>::T

Source§

type M = M

Source§

type C = <M as MatrixCommon>::C

Source§

impl<M, I, J> Op for ConstantClosureWithAdjoint<M, I, J>
where M: Matrix, I: Fn(&M::V, M::T, &mut M::V), J: Fn(&M::V, M::T, &M::V, &mut M::V),

Source§

type V = <M as MatrixCommon>::V

Source§

type T = <M as MatrixCommon>::T

Source§

type M = M

Source§

type C = <M as MatrixCommon>::C

Source§

impl<M, I, J> Op for ConstantClosureWithSens<M, I, J>
where M: Matrix, I: Fn(&M::V, M::T, &mut M::V), J: Fn(&M::V, M::T, &M::V, &mut M::V),

Source§

type V = <M as MatrixCommon>::V

Source§

type T = <M as MatrixCommon>::T

Source§

type M = M

Source§

type C = <M as MatrixCommon>::C

Source§

impl<M, Rhs, Init, Mass, Root, Out, Reset> Op for OdeSolverEquations<M, Rhs, Init, Mass, Root, Out, Reset>
where M: Matrix, Init: Op<M = M, V = M::V, T = M::T, C = M::C>, Rhs: Op<M = M, V = M::V, T = M::T, C = M::C>, Mass: Op<M = M, V = M::V, T = M::T, C = M::C>, Root: Op<M = M, V = M::V, T = M::T, C = M::C>, Out: Op<M = M, V = M::V, T = M::T, C = M::C>, Reset: Op<M = M, V = M::V, T = M::T, C = M::C>,

Source§

type T = <M as MatrixCommon>::T

Source§

type V = <M as MatrixCommon>::V

Source§

type M = M

Source§

type C = <M as MatrixCommon>::C

Source§

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

Source§

type V = <M as MatrixCommon>::V

Source§

type T = <M as MatrixCommon>::T

Source§

type M = M

Source§

type C = <M as MatrixCommon>::C

Source§

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

Source§

type T = <M as MatrixCommon>::T

Source§

type V = <M as MatrixCommon>::V

Source§

type M = M

Source§

type C = <M as MatrixCommon>::C

Source§

impl<M: Matrix<T: DiffSlScalar>, CG: CodegenModule> Op for DiffSlInit<'_, M, CG>

Source§

type M = M

Source§

type T = <M as MatrixCommon>::T

Source§

type V = <M as MatrixCommon>::V

Source§

type C = <M as MatrixCommon>::C

Source§

impl<M: Matrix<T: DiffSlScalar>, CG: CodegenModule> Op for DiffSlMass<'_, M, CG>

Source§

type M = M

Source§

type T = <M as MatrixCommon>::T

Source§

type V = <M as MatrixCommon>::V

Source§

type C = <M as MatrixCommon>::C

Source§

impl<M: Matrix<T: DiffSlScalar>, CG: CodegenModule> Op for DiffSlOut<'_, M, CG>

Source§

type M = M

Source§

type T = <M as MatrixCommon>::T

Source§

type V = <M as MatrixCommon>::V

Source§

type C = <M as MatrixCommon>::C

Source§

impl<M: Matrix<T: DiffSlScalar>, CG: CodegenModule> Op for DiffSlReset<'_, M, CG>

Source§

type M = M

Source§

type T = <M as MatrixCommon>::T

Source§

type V = <M as MatrixCommon>::V

Source§

type C = <M as MatrixCommon>::C

Source§

impl<M: Matrix<T: DiffSlScalar>, CG: CodegenModule> Op for DiffSlRhs<'_, M, CG>

Source§

type M = M

Source§

type T = <M as MatrixCommon>::T

Source§

type V = <M as MatrixCommon>::V

Source§

type C = <M as MatrixCommon>::C

Source§

impl<M: Matrix<T: DiffSlScalar>, CG: CodegenModule> Op for DiffSlRoot<'_, M, CG>

Source§

type M = M

Source§

type T = <M as MatrixCommon>::T

Source§

type V = <M as MatrixCommon>::V

Source§

type C = <M as MatrixCommon>::C

Source§

impl<M: MatrixHost<T: DiffSlScalar>, CG: CodegenModule> Op for DiffSl<M, CG>

Source§

type M = M

Source§

type T = <M as MatrixCommon>::T

Source§

type V = <M as MatrixCommon>::V

Source§

type C = <M as MatrixCommon>::C