lazymatrix::SubmatrixKernel
LazyMatrix for Rust · 0.8.1
pub trait SubmatrixKernel<F: Scalar>: MatrixShape + MatrixErrorTypeRectangular 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
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>Write normalized rectangular entries into caller-selected dense storage.
submatrix_matvec_into
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>Compute a normalized rectangular forward product into reusable storage.
submatrix_transpose_into
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>Compute a normalized rectangular transpose product into reusable storage.
Implementation of SubmatrixKernel
impl<M: lazymatrix::SubmatrixKernel<F>, F: Scalar> SubmatrixKernel<F> for SprsCsc<M>Implementation of SubmatrixKernel
impl<M: lazymatrix::SubmatrixKernel<F>, F: Scalar> SubmatrixKernel<F> for SprsCsr<M>
