SciML / SciML/SparseWithDenseRowColMatrices.jl
Add a LinearSolve algorithm that wraps `lstsq` — the LinearSolve extension cannot solve rank-deficient/inconsistent A
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 0
- Forks
- 1
- Avg merge
- 14m
- Merged PRs (30d)
- 6
Description
WHAT: ext/SparseWithDenseRowColMatricesLinearSolveExt.jl has zero references to lstsq/LeastSquares/pinv. Both existing algs (SWDRCFactorizationAlg, SWDRCQRFactorizationAlg) map a singular A to ReturnCode.Infeasible (lines 104-106, 166-168), so there is no way to get the min-norm A⁺b through the LinearSolve interface despite the full lstsq machinery existing. WHY IT MATTERS: LinearSolve is the standard SciML entry point and the natural home for the cached factorization; users in a LinearSolve pipeline cannot reach lstsq at all. FIX: Add SWDRCLeastSquaresAlg (mirroring the QR alg): init_cacheval builds a SparseWithDenseRowColLeastSquares (dense-COD fallback when structured doesn't apply), solve! does ldiv!(cache.u, F, cache.b), and once the LS refactor! lands its _refresh! reuses symbolic analysis across cache.A updates. Expose a public SparseWithDenseRowColLeastSquaresFactorization(; alg=:auto, tolC=...) in src/factorize.jl. Add a test/test_linearsolve.jl block (currently only LU+QR algs tested). Best done after or alongside the LS refactor! issue. EFFORT: M.
Priority: high. Filed from an automated next-steps audit of the QR/lstsq work (see PR #6).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read ext/SparseWithDenseRowColMatricesLinearSolveExt.jl alongside the existing SWDRCQRFactorizationAlg, then review src/factorize.jl and the LS refactor! work. Add the LinearSolve least-squares algorithm and public factorization described in the issue, and extend test/test_linearsolve.jl so the rank-deficient or inconsistent case is covered and cache.A updates reuse the analysis.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100