Skip to content

lazymatrix::SubmatrixKernel ​

LazyMatrix for Rust · 0.8.1

Source

rust
pub trait SubmatrixKernel<F: Scalar>: MatrixShape + MatrixErrorType

Rectangular kernels over raw storage, with optional fitted normalization.

Ranges are relative to this source. Parameter slices describe only the selected columns. Implementations must validate ranges, dimensions, and parameters before reading storage or writing output. Empty rectangles need no storage reads. No kernel may materialize a full source matrix.

Products preserve the fused product contracts: zero alpha skips source reads, zero beta ignores previous output, and dimensions are always checked. On an operational error, output may be partial. Materialization combines raw duplicates before normalization and includes implicit zeros.

Methods ​

materialize_submatrix_into ​

rust
fn materialize_submatrix_into<O: MatrixWrite<F> + ?Sized>(
    &self,
    rows: Range<usize>,
    columns: Range<usize>,
    centers: Option<&[F]>,
    scales: Option<&[F]>,
    out: &mut O
) -> Result<(), <Self as MatrixErrorType>::Error>

Source

Write normalized rectangular entries into caller-selected dense storage.

submatrix_matvec_into ​

rust
fn submatrix_matvec_into<X: VectorView<F> + ?Sized, Y: VectorViewMut<F> + ?Sized>(
    &self,
    rows: Range<usize>,
    columns: Range<usize>,
    centers: Option<&[F]>,
    scales: Option<&[F]>,
    alpha: F,
    x: &X,
    beta: F,
    out: &mut Y
) -> Result<(), <Self as MatrixErrorType>::Error>

Source

Compute a normalized rectangular forward product into reusable storage.

submatrix_transpose_into ​

rust
fn submatrix_transpose_into<X: VectorView<F> + ?Sized, Y: VectorViewMut<F> + ?Sized>(
    &self,
    rows: Range<usize>,
    columns: Range<usize>,
    centers: Option<&[F]>,
    scales: Option<&[F]>,
    alpha: F,
    x: &X,
    beta: F,
    out: &mut Y
) -> Result<(), <Self as MatrixErrorType>::Error>

Source

Compute a normalized rectangular transpose product into reusable storage.

Implementation of SubmatrixKernel ​

Source

rust
impl<M: lazymatrix::SubmatrixKernel<F>, F: Scalar> SubmatrixKernel<F> for SprsCsc<M>

Implementation of SubmatrixKernel ​

Source

rust
impl<M: lazymatrix::SubmatrixKernel<F>, F: Scalar> SubmatrixKernel<F> for SprsCsr<M>

Released under the MIT and Apache 2.0 licenses.