Skip to content

lazymatrix::WeightedColumnSumsKernel ​

LazyMatrix for Rust · 0.8.1

Source

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

Backend weighted-column sums with explicit normalization.

Accumulate ((X[i,j] - centers[j]) / scales[j]) * weights[i], applying subtraction and division only when the corresponding slice is present. LazyMatrix forwards its normalization here. The output and error contracts are those of WeightedColumnSumsInto.

Panics ​

In addition to product dimensions, validate normalization slice lengths and reject exact zero scales, including negative zero, before writing output.

Methods ​

weighted_column_sums_normalized_into ​

rust
fn weighted_column_sums_normalized_into<W, O>(
    &self,
    weights: &W,
    centers: Option<&[F]>,
    scales: Option<&[F]>,
    out: &mut O
) -> Result<(), <Self as MatrixErrorType>::Error> where W: VectorView<F> + ?Sized, O: VectorViewMut<F> + ?Sized

Source

Implementation of WeightedColumnSumsKernel ​

Source

rust
impl<F, IP, IS, DS, Iptr> WeightedColumnSumsKernel<F> for lazymatrix::SprsCsc<sprs::CsMatBase<F, usize, IP, IS, DS, Iptr>> where F: Scalar, Iptr: SpIndex, IP: Deref<Target = [Iptr]>, IS: Deref<Target = [usize]>, DS: Deref<Target = [F]>

Implementation of WeightedColumnSumsKernel ​

Source

rust
impl<M: WeightedColumnSumsKernel<F>, F: Scalar, T> WeightedColumnSumsKernel<F> for EagerMatrix<M, T>

Released under the MIT and Apache 2.0 licenses.