Skip to main content

Crate trueno_solve

Crate trueno_solve 

Source
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§

CholeskyFactorization
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.
TrsmResult
Triangular solve result.

Enums§

DiagonalType
Whether the diagonal is unit (all ones) or general.
Epilogue
Epilogue operation applied after GEMM computation.
SolverError
Errors from solver operations.
TriangularSide
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.