Skip to content

lazymatrix::RectangularProducts ​

LazyMatrix for Rust · 0.12.0

Source

rust
pub trait RectangularProducts: MatrixShape + MatrixErrorType

Vector products restricted to a rectangle of a logical operator.

Ranges refer to the parent operator, while input and output indices are local to the rectangle. Implementations preserve the parent's fitted transformation, including stage order, without fitting new statistics. They visit only selected dense entries, selected sparse outer storage, or intersecting storage chunks, using bounded workspace.

Validate ranges and dimensions before reading data or modifying outputs. Zero alpha skips all source reads, and zero beta ignores previous output values. Empty inner dimensions represent empty sums. On a backend error, output may be partial; normalization corrections follow successful reads.

Associated types ​

Scalar ​

rust
type Scalar: Scalar;

Source

Scalar of the logical entries and product vectors.

Methods ​

rectangle_matvec_into ​

rust
fn rectangle_matvec_into<X, Y>(
    &self,
    rows: Range<usize>,
    columns: Range<usize>,
    alpha: <Self as RectangularProducts>::Scalar,
    x: &X,
    beta: <Self as RectangularProducts>::Scalar,
    out: &mut Y
) -> Result<(), <Self as MatrixErrorType>::Error> where X: VectorView<<Self as RectangularProducts>::Scalar> + ?Sized, Y: VectorViewMut<<Self as RectangularProducts>::Scalar> + ?Sized

Source

Compute out = alpha * self[rows, columns] * x + beta * out.

rectangle_transpose_into ​

rust
fn rectangle_transpose_into<X, Y>(
    &self,
    rows: Range<usize>,
    columns: Range<usize>,
    alpha: <Self as RectangularProducts>::Scalar,
    x: &X,
    beta: <Self as RectangularProducts>::Scalar,
    out: &mut Y
) -> Result<(), <Self as MatrixErrorType>::Error> where X: VectorView<<Self as RectangularProducts>::Scalar> + ?Sized, Y: VectorViewMut<<Self as RectangularProducts>::Scalar> + ?Sized

Source

Compute out = alpha * self[rows, columns]^T * x + beta * out.

Implementation of RectangularProducts ​

Source

rust
impl<M, A, B> RectangularProducts for lazymatrix::LazyMatrix<M, lazymatrix::NormalizationChainParams<A, B>> where M: MatrixShape + MatrixErrorType, lazymatrix::NormalizationChainParams<A, B>: Stage, <lazymatrix::NormalizationChainParams<A, B> as Stage>::Kind: ChainRectangle<M, lazymatrix::NormalizationChainParams<A, B>>

Implementation of RectangularProducts ​

Source

rust
impl<M, P> RectangularProducts for lazymatrix::EagerMatrix<M, P> where P: NormalizationParams, M: SubmatrixKernel<<P as NormalizationParams>::Scalar>

Implementation of RectangularProducts ​

Source

rust
impl<M: MatrixTraversal<F>, F: Scalar, S: AsRef<[F]>> RectangularProducts for lazymatrix::LazyMatrix<M, lazymatrix::RowNormalizationParams<F, S>>

Implementation of RectangularProducts ​

Source

rust
impl<M: SubmatrixKernel<F>, F: Scalar, S: AsRef<[F]>> RectangularProducts for lazymatrix::LazyMatrix<M, lazymatrix::ColumnNormalizationParams<F, S>>

Implementation of RectangularProducts ​

Source

rust
impl<O: RectangularProducts + ?Sized> RectangularProducts for lazymatrix::Submatrix<'_, O>

Implementation of RectangularProducts ​

Source

rust
impl<O: RectangularProducts + ?Sized> RectangularProducts for lazymatrix::Transpose<'_, O>

Released under the MIT and Apache 2.0 licenses.