Skip to content

lazymatrix::RowNormalizationKernel ​

LazyMatrix for Rust · 0.9.0

Source

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

Vector products over raw storage with optional fitted row parameters.

Kernels normalize logical entries before multiplication, combine duplicates, and include the normalized background of implicit zeros. They preserve storage orientation and use bounded workspace. Dimensions, parameter lengths, and explicit zero scales must be checked before reads or output writes. Output may be partial after a storage error.

Methods ​

dense_row_normalized_product_into ​

rust
fn dense_row_normalized_product_into<X: VectorView<F> + ?Sized, Y: VectorViewMut<F> + ?Sized>(
    &self,
    transpose: bool,
    x: &X,
    centers: Option<&[F]>,
    scales: Option<&[F]>,
    out: &mut Y
) -> Result<(), <Self as MatrixErrorType>::Error> where Self: MatrixRead<F>

Source

Compute either product directly from dense indexed storage.

Dense adapters can delegate both kernels here, selecting the transpose with transpose. Entries are centered and scaled before accumulation. The kernel needs no workspace beyond out.

row_normalized_matvec_into ​

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

Source

Overwrite out with the row-normalized forward product.

row_normalized_transpose_into ​

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

Source

Overwrite out with the row-normalized transpose product.

Implementation of RowNormalizationKernel ​

Source

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

Implementation of RowNormalizationKernel ​

Source

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

Released under the MIT and Apache 2.0 licenses.