Back to Sparse Direct Solver (SuperLU)
slu.solvers.solveLeastSquaresSparse
Solve a sparse least squares problem min ||Ax - b||_2.
Syntax
slu.solvers.solveLeastSquaresSparse(A, b, options?)
Description
Solve a sparse least squares problem min ||Ax - b||_2. For overdetermined systems (m > n), this finds the solution x that minimizes the 2-norm of the residual. The solver uses the normal equations approach: A^T A x = A^T b. For square or underdetermined systems, consider using solveSparseCSC directly instead.
Parameters
| Name | Description |
|---|---|
| A | - Sparse matrix in CSC format (m x n, m >= n) |
| b | - Right-hand side vector (length m) |
| options(optional) | - Solver options |
Returns
LeastSquaresResult