lazymatrix::RowNormalizationKernel
LazyMatrix for Rust · 0.9.0
pub trait RowNormalizationKernel<F: Scalar>: MatrixShape + MatrixErrorTypeVector 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
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>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
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>Overwrite out with the row-normalized forward product.
row_normalized_transpose_into
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>Overwrite out with the row-normalized transpose product.
Implementation of RowNormalizationKernel
impl<M: lazymatrix::RowNormalizationKernel<F>, F: Scalar> RowNormalizationKernel<F> for SprsCsc<M>Implementation of RowNormalizationKernel
impl<M: lazymatrix::RowNormalizationKernel<F>, F: Scalar> RowNormalizationKernel<F> for SprsCsr<M>
