Skip to main content

Module matrix_kernels

Module matrix_kernels 

Source
Expand description

SIMD-accelerated matrix kernels operating on MatrixData.

All functions operate directly on MatrixData (row-major, SIMD-aligned) to avoid the overhead of nested-array extraction in the old matrix.rs.

Functionsยง

matrix_add
Element-wise matrix addition: C = A + B (same dimensions).
matrix_determinant
Matrix determinant via LU decomposition (partial pivoting).
matrix_element_mul
Element-wise (Hadamard) multiplication: C[i,j] = A[i,j] * B[i,j].
matrix_inverse
Matrix inverse via Gauss-Jordan elimination. Only works for square matrices.
matrix_matmul
Matrix multiplication: C = A * B. A is (m x k), B is (k x n), result is (m x n).
matrix_matvec
Matrix-vector multiplication: y = A * v. A is (m x n), v has length n, result has length m.
matrix_scale
Scalar multiplication: C = A * scalar.
matrix_sub
Element-wise matrix subtraction: C = A - B (same dimensions).
matrix_trace
Matrix trace: sum of diagonal elements.
matrix_transpose
Matrix transpose: B = A^T.