LinearOperator

Trait LinearOperator 

Source
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§

Source

fn num_rows(&self) -> usize

Number of rows in the operator

Source

fn num_cols(&self) -> usize

Number of columns in the operator

Source

fn apply(&self, x: &Array1<T>) -> Array1<T>

Apply the operator: y = A * x

Source

fn apply_transpose(&self, x: &Array1<T>) -> Array1<T>

Apply the transpose: y = A^T * x

Provided Methods§

Source

fn apply_hermitian(&self, x: &Array1<T>) -> Array1<T>

Apply the Hermitian (conjugate transpose): y = A^H * x

Source

fn is_square(&self) -> bool

Check if the operator is square

Implementors§