SpecializedMatrix

Trait SpecializedMatrix 

Source
pub trait SpecializedMatrix<A>
where A: Float + NumAssign + Zero + Sum + One + ScalarOperand + Send + Sync + Debug,
{ // 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§

Source

fn nrows(&self) -> usize

Return the number of rows in the matrix

Source

fn ncols(&self) -> usize

Return the number of columns in the matrix

Source

fn get(&self, i: usize, j: usize) -> LinalgResult<A>

Get the element at position (i, j)

Source

fn matvec(&self, x: &ArrayView1<'_, A>) -> LinalgResult<Array1<A>>

Perform matrix-vector multiplication: A * x

Source

fn matvec_transpose(&self, x: &ArrayView1<'_, A>) -> LinalgResult<Array1<A>>

Perform transposed matrix-vector multiplication: A^T * x

Source

fn to_dense(&self) -> LinalgResult<Array2<A>>

Convert to a dense matrix representation

Provided Methods§

Source

fn to_operator(&self) -> LinalgResult<LinearOperator<A>>
where Self: Sync + 'static + Sized,

Convert to a matrix-free operator

Implementors§