Skip to main content

mds_multiply

Function mds_multiply 

Source
pub fn mds_multiply<F, A, const WIDTH: usize>(
    state: &mut [A; WIDTH],
    matrix: &[[F; WIDTH]; WIDTH],
)
Expand description

Dense matrix-vector product, applied in place to a fixed-width state vector.

§Overview

  • Generic O(t^2) fallback for any dense square matrix.
  • Circulant matrices have faster paths in this module (Karatsuba, FFT).
  • Sparse or diagonal layouts can skip full-row scans entirely.

§Arguments

  • The state vector, overwritten with the product on return.
  • The matrix, indexed row-first as m[row][col].

§Performance

  • Runtime: O(t^2) ring operations for a width-t state.
  • Allocations: one stack snapshot of the input state.