Skip to content

Property test: LU and QR reconstruction identities on random matrices #103

Description

@kmolan

What: Add property tests asserting the reconstruction identities of the dense decompositions on random matrices: P·A = L·U (with L unit-lower-triangular and U upper-triangular) and A = Q·R (with QᵀQ = I and R upper-triangular), across a few const-generic sizes including a rectangular case for QR. Golden tests pin known matrices; this proves the factorizations on inputs nobody hand-picked. Scoped slice of #10.

Where: crates/multicalc/tests/linear_algebra/lu.rs and crates/multicalc/tests/linear_algebra/qr.rs (the existing per-decomposition test files). Code under test: crates/multicalc/src/linear_algebra/{lu,qr}.rs. Add proptest under the existing [target.'cfg(not(target_arch = "arm"))'.dev-dependencies] table in crates/multicalc/Cargo.toml (dev-only).

How to test: cargo test -p multicalc --test linear_algebra. Passing = reconstruction plus structural assertions (triangularity, orthonormality) within a tolerance scaled by the matrix norm and f64::EPSILON — random matrices can be mildly ill-conditioned, so either bound the generator (e.g. reject tiny pivots) or scale the tolerance; a fixed constant will flake.

Mentoring: I'll answer questions on this issue within 48 h and review your PR promptly. Comment to claim it so nobody double-works. If anything above is unclear, that's my bug — ask.

Metadata

Metadata

Assignees

No one assigned

    Labels

    accuracyNumerical-accuracy focusgood first issueGood for newcomershelp wantedExtra attention is neededlinalgVectors, matrices, decompositionstestingTest infrastructure

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions