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§
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§
Provided Methods§
Sourcefn statistics(&self) -> OpStatistics
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.)