Skip to main content

Module linear_algebra

Module linear_algebra 

Source
Expand description

Linear Algebra & Matrix Solvers - Zero-Allocation Implementation

This module provides fixed-size stack-based linear algebra solvers for eigenvalue problems, linear systems, and tensor operations suitable for the #![no_std] environment of Qualia-DB.

Modules§

cholesky
Dynamic-size, caller-owned-buffer decompositions (nalgebra-parity, zero-heap). Cholesky decomposition A = L·Lᵀ for symmetric positive-definite matrices.
eigen
Symmetric eigendecomposition — closed-form 3×3 + general Jacobi (caller-owned). Symmetric eigendecomposition — the engine’s single home for eigenvalues of a symmetric matrix.
gemm
Dynamic-size general matrix multiply (caller-owned, zero-heap) — the canonical dense-GEMM core the specialized libs and the GPU coop_gemv backend share. Dynamic-size general matrix multiply (GEMM) — the canonical dense-linear-algebra core.
lu
Dynamic LU decomposition (partial pivoting) + determinant — canonical n×n LU. Dynamic LU decomposition with partial pivoting (P·A = L·U) and determinant.
qr
Householder QR factorisation + least-squares solve (caller-owned, zero-heap). Householder QR decomposition A = Q·R and least-squares solve.
spectral
Matrix-spectral bridge: characteristic polynomial + general (non-symmetric) eigenvalues. Matrix-spectral routines that bridge linear algebra and polynomial algebra: the characteristic polynomial and general (non-symmetric) eigenvalues.
svd
Thin singular value decomposition A = U·Σ·Vᵀ (via AᵀA eigendecomposition). Thin singular value decomposition A = U·Σ·Vᵀ of a row-major m×n matrix.
vector
Element-wise vector ops (add / Hadamard / scale / axpy) — residual stream + gated activations. Dynamic element-wise vector operations — the foundational rank-1 linear algebra the transformer is built from beyond GEMM: the residual connection (x + sublayer(x)) is vector addition, and the gated activation (SwiGLU) uses the Hadamard product (element-wise multiply). Plain arithmetic; caller-owned, zero allocation.

Structs§

ConstTensorContractor
Constant tensor contraction solver
FixedLanczosEigensolver
Lanczos eigensolver for finding lowest eigenvalues
Matrix4x4
Fixed-size 4x4 matrix for stack-based operations
StaticLuDecomposition
Static LU decomposition solver
Tensor3x3x3
Fixed-size 3x3x3 tensor
Vector4
Fixed-size 4-element vector