pub trait LinearOperator<T: ComplexField>: Send + Sync {
// Required methods
fn num_rows(&self) -> usize;
fn num_cols(&self) -> usize;
fn apply(&self, x: &Array1<T>) -> Array1<T>;
fn apply_transpose(&self, x: &Array1<T>) -> Array1<T>;
// Provided methods
fn apply_hermitian(&self, x: &Array1<T>) -> Array1<T> { ... }
fn is_square(&self) -> bool { ... }
}Expand description
Trait for linear operators (matrices) that can perform matrix-vector products.
This abstraction allows solvers to work with dense matrices, sparse matrices, and matrix-free operators (e.g., FMM) interchangeably.
Required Methods§
Sourcefn apply_transpose(&self, x: &Array1<T>) -> Array1<T>
fn apply_transpose(&self, x: &Array1<T>) -> Array1<T>
Apply the transpose: y = A^T * x
Provided Methods§
Sourcefn apply_hermitian(&self, x: &Array1<T>) -> Array1<T>
fn apply_hermitian(&self, x: &Array1<T>) -> Array1<T>
Apply the Hermitian (conjugate transpose): y = A^H * x