Skip to content

SparseWithDenseRowColLeastSquares has no fixed-pattern refactor! — the README's headline Newton-loop claim is currently false #9

@ChrisRackauckas-Claude

Description

@ChrisRackauckas-Claude

WHAT: The cached LS factorization (src/lstsq.jl:164-173) stores a PureKLU factorization Sfact but exposes no value-update path; refactor!/update_lowrank!/lu! exist only for Woodbury/Augmented/QR. So a Newton/time-stepping loop that changes S's values (same sparsity pattern) cannot reuse it — each new A redoes the full KLU symbolic analysis (BTF + AMD) plus a fresh pivoted-QR and two SVDs. WHY IT MATTERS: The README (line 220) advertises the cached factorization 'for a Newton / time-stepping loop', but the constructor only supports a fixed A — the headline use case is currently unreachable. PureKLU already exposes klu!/klu_refactor! (the same symbolic-reuse calls Woodbury's refactor uses at src/woodbury.jl:276). FIX: Add refactor!(F::SparseWithDenseRowColLeastSquares, A; check=true) that copyto!s new nzval into owned Sown, calls PureKLU.klu!(F.Sfact, nz) (reuse symbolic + workspace), then re-runs only the value-dependent tail (Z=S̃⁻¹U, κ̂(S) guard, C, pivoted QR of [Z|Vᴴ], W, Msp, QL). Requires splitting _structured_setup into 'symbolic+allocate' vs 'numeric fill', and making rank-dependent fields (W/QL/Msp) the mutable/reallocatable part since kdef can change with values. Add an Snzval-only fast form mirroring src/woodbury.jl:271. EFFORT: M.


Priority: high. Filed from an automated next-steps audit of the QR/lstsq work (see PR #6).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions