Summary
Follow up on the whole-repo Rust simplification review with two conservative cleanup targets that preserve the parse/proof invariant model.
Current State
- LU and LDLT each carry local
invalid_tolerance_rejected tests even though those tests now only exercise Tolerance::new; factorization APIs accept a proven Tolerance, not raw f64.
Vector::try_new and FiniteVector::new each implement their own entry-by-entry finiteness scan.
- Matrix code already uses a shared helper pattern for locating the first non-finite stored cell.
Proposed Changes
- Remove redundant LU/LDLT tolerance-constructor tests if central
Tolerance coverage remains complete.
- Add a small private vector helper such as
first_non_finite_entry_in(&[f64; D]) -> Option<usize> and use it from both public raw parsing and crate-internal proof wrapping.
- Keep public APIs and unchecked constructors unchanged.
Benefits
- Reduces duplicated tests that no longer cover factorization-specific behavior.
- Reduces drift risk between public vector construction and internal proof-bearing vector validation.
- Keeps the parse-don't-validate / proven DTO model intact.
Implementation Notes
- Do not collapse
set/set_checked, get/get_checked, Tolerance::new/LaError::validate_tolerance, or factor wrapper types; those preserve API ergonomics, typed diagnostics, compatibility, or invariant naming.
- Validate with
just check and cargo test --all-features.
Related: #137, #138
Summary
Follow up on the whole-repo Rust simplification review with two conservative cleanup targets that preserve the parse/proof invariant model.
Current State
invalid_tolerance_rejectedtests even though those tests now only exerciseTolerance::new; factorization APIs accept a provenTolerance, not rawf64.Vector::try_newandFiniteVector::neweach implement their own entry-by-entry finiteness scan.Proposed Changes
Tolerancecoverage remains complete.first_non_finite_entry_in(&[f64; D]) -> Option<usize>and use it from both public raw parsing and crate-internal proof wrapping.Benefits
Implementation Notes
set/set_checked,get/get_checked,Tolerance::new/LaError::validate_tolerance, or factor wrapper types; those preserve API ergonomics, typed diagnostics, compatibility, or invariant naming.just checkandcargo test --all-features.Related: #137, #138