lazymatrix::WeightedColumnSumsKernel
LazyMatrix for Rust · 0.8.1
rust
pub trait WeightedColumnSumsKernel<F: Scalar>: MatrixShape + MatrixErrorTypeBackend 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> + ?SizedImplementation of WeightedColumnSumsKernel
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
rust
impl<M: WeightedColumnSumsKernel<F>, F: Scalar, T> WeightedColumnSumsKernel<F> for EagerMatrix<M, T>
