gMath

Linear algebra

Decompositions, derived quantities, and matrix functions over FixedMatrix, each chained at the wide compute tier.

What it is

Three modules build on FixedMatrix: decompose (factorizations and the solvers built on them), derived (norms, inverses, condition numbers, least squares), and matrix_functions (exp, log, sqrt, pow of a matrix). Operation chains run through a ComputeMatrix at tier N+1 so the whole chain rounds once at the end rather than once per intermediate.

Usage

use g_math::fixed_point::{FixedMatrix, FixedVector, FixedPoint};
use g_math::fixed_point::imperative::decompose;

let a = FixedMatrix::from_slice(2, 2, &[
    FixedPoint::from_int(4), FixedPoint::from_int(3),
    FixedPoint::from_int(6), FixedPoint::from_int(3),
]);
let lu = decompose::lu_decompose(&a).unwrap();   // Doolittle, partial pivoting
let b = FixedVector::from_slice(&[FixedPoint::from_int(1), FixedPoint::from_int(2)]);
let x = lu.solve(&b).unwrap();                    // solve A x = b
let det = lu.determinant();

What's here

Public API

See PUBLIC_API.md → Linear algebra and docs.rs.

Behaviour & limits

Determinism guarantees are in CONTRACT.md.

Disclaimer

This software is provided "as is", without warranty of any kind, express or implied. Use of this software is entirely at your own risk. In no event shall the author or contributors be held liable for any damages arising from the use or inability to use this software.


Built by Niels Erik Toren · support & donations.