Skip to main content

gemm

Function gemm 

Source
pub fn gemm(
    transa: Transpose,
    transb: Transpose,
    m: usize,
    n: usize,
    k: usize,
    alpha: f64,
    a: &[f64],
    b: &[f64],
    beta: f64,
    c: &mut [f64],
) -> Result<(), SolversError>
Expand description

General matrix multiply (BLAS-3 gemm shape), row-major, zero-heap:

C := alpha · op(A) · op(B) + beta · C

where op(A) is m×k, op(B) is k×n, and C is m×n. Operands are caller-owned row-major slices:

  • a holds op==No ? m×k : k×m → always m*k elements.
  • b holds op==No ? k×n : n×k → always k*n elements.
  • c is m*n elements, read (when beta != 0) and overwritten in place.

beta == 0.0 is honoured as a hard zero (the existing contents of c, which may be uninitialised garbage, are not read) — matching BLAS semantics so a fresh output buffer need not be zeroed first.

Returns SolversError::InvalidDimension if any slice length disagrees with m, n, k.