pub trait SpecializedMatrix<A>{
// Required methods
fn nrows(&self) -> usize;
fn ncols(&self) -> usize;
fn get(&self, i: usize, j: usize) -> LinalgResult<A>;
fn matvec(&self, x: &ArrayView1<'_, A>) -> LinalgResult<Array1<A>>;
fn matvec_transpose(&self, x: &ArrayView1<'_, A>) -> LinalgResult<Array1<A>>;
fn to_dense(&self) -> LinalgResult<Array2<A>>;
// Provided method
fn to_operator(&self) -> LinalgResult<LinearOperator<A>>
where Self: Sync + 'static + Sized { ... }
}
Expand description
A trait for specialized matrices that enables efficient storage and operations
Required Methods§
Sourcefn get(&self, i: usize, j: usize) -> LinalgResult<A>
fn get(&self, i: usize, j: usize) -> LinalgResult<A>
Get the element at position (i, j)
Sourcefn matvec(&self, x: &ArrayView1<'_, A>) -> LinalgResult<Array1<A>>
fn matvec(&self, x: &ArrayView1<'_, A>) -> LinalgResult<Array1<A>>
Perform matrix-vector multiplication: A * x
Sourcefn matvec_transpose(&self, x: &ArrayView1<'_, A>) -> LinalgResult<Array1<A>>
fn matvec_transpose(&self, x: &ArrayView1<'_, A>) -> LinalgResult<Array1<A>>
Perform transposed matrix-vector multiplication: A^T * x
Sourcefn to_dense(&self) -> LinalgResult<Array2<A>>
fn to_dense(&self) -> LinalgResult<Array2<A>>
Convert to a dense matrix representation
Provided Methods§
Sourcefn to_operator(&self) -> LinalgResult<LinearOperator<A>>
fn to_operator(&self) -> LinalgResult<LinearOperator<A>>
Convert to a matrix-free operator