SciML / SciML/SparseWithDenseRowColMatrices.jl

Add a LinearSolve algorithm that wraps `lstsq` — the LinearSolve extension cannot solve rank-deficient/inconsistent A

Open
#10 0 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.