pub trait LaLinearOp {
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 nrows(&self) -> usize;
fn ncols(&self) -> usize;
fn context(&self) -> &Self::C;
fn matrix_inplace(&self, y: &mut Self::M);
// Provided method
fn sparsity(&self) -> Option<<Self::M as Matrix>::Sparsity> { ... }
}Expand description
A linear operator A for use with the crate::LinearSolver trait.
This is a minimal, time-unaware description of a linear operator: it can
report its shape and context, materialise itself as a matrix, and optionally
provide a sparsity pattern. It is deliberately decoupled from the richer,
time-aware operator traits in the diffsol crate.
A solver for Ax = b uses Self::sparsity to set up the matrix storage and
Self::matrix_inplace to populate the matrix A prior to factorisation.
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§
Sourcefn ncols(&self) -> usize
fn ncols(&self) -> usize
Number of columns of the operator (i.e. length of the input vector x).
Sourcefn matrix_inplace(&self, y: &mut Self::M)
fn matrix_inplace(&self, y: &mut Self::M)
Compute the matrix representation of the operator A and store it in y.
y is assumed to have been initialised with the sparsity pattern
returned by Self::sparsity.
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".