Expand description
Dense linear algebra solvers with provable contracts.
§Solvers
- LU: Partial pivoting, PA = LU
- QR: Householder reflections, A = QR
- SVD: One-sided Jacobi, A = UΣV^T
- Cholesky: A = LL^T for positive definite matrices
§Example
use trueno_solve::lu_factorize;
// Solve Ax = b where A = [[2, 1], [1, 3]]
let a = [2.0, 1.0, 1.0, 3.0_f32];
let lu = lu_factorize(&a, 2).unwrap();
let x = lu.solve(&[5.0, 7.0]).unwrap();
// x ≈ [1.6, 1.8]
assert!((x[0] - 1.6).abs() < 1e-5);
assert!((x[1] - 1.8).abs() < 1e-5);Structs§
- Cholesky
Factorization - Cholesky factorization result.
- LuFactorization
- LU factorization result (in-place: L and U stored in the same matrix).
- QrFactorization
- QR factorization result.
- SvdResult
- SVD result: A = U * diag(sigma) * V^T.
- Trsm
Result - Triangular solve result.
Enums§
- Diagonal
Type - Whether the diagonal is unit (all ones) or general.
- Epilogue
- Epilogue operation applied after GEMM computation.
- Solver
Error - Errors from solver operations.
- Triangular
Side - Whether the triangular matrix is lower or upper.
Traits§
- Solver
- Unified solver trait for factorization-based linear system solving.
Functions§
- cholesky
- Cholesky factorization: A = L L^T.
- f32_
to_ f16 - Convert f32 to IEEE 754 half-precision (u16).
- gemm_ex
- Mixed-precision GEMM: C = α·A·B + β·C with f16 inputs, f32 accumulation.
- gemm_
ex_ epilogue - Mixed-precision GEMM with epilogue fusion.
- gemm_
strided_ batched - Strided batched GEMM: C_b = α·A_b·B_b + β·C_b for b = 0..batch_count.
- lu_
factorize - LU factorization with partial pivoting.
- qr_
factorize - QR factorization via Householder reflections.
- svd
- Compute SVD via one-sided Jacobi rotations.
- symm
- Symmetric matrix multiply: C = α·A·B + β·C
- syr2k
- Symmetric rank-2k update: C = α·A·Bᵀ + α·B·Aᵀ + β·C
- syrk
- Symmetric rank-k update: C = α·A·Aᵀ + β·C
- trmm
- Triangular matrix multiply: B = α·A·B (left side, lower triangular).
- trsm
- Solve AX = B where A is triangular.