Skip to main content

Module debug_rank

Module debug_rank 

Source
Expand description

Numerical rank diagnosis of the active-constraint Jacobian.

When the interior-point solver applies dual regularization δ_c (or reports wrong KKT inertia), the usual root cause is a (near) rank-deficient constraint Jacobian — linearly dependent or redundant equality constraints, i.e. an LICQ failure. The debugger already detects this as a scalar (δ_c > 0) and names structurally dependent rows via a Dulmage–Mendelsohn pass on the sparsity pattern (pounce-presolve). This module closes the remaining gap: a numerical rank-revealing SVD of the equality Jacobian at the current iterate, which localizes the dependency to the specific equations that participate in it — including dependencies that are numerical only (cancelling values over a full-rank pattern), which the structural pass cannot see.

The math. For the equality Jacobian A (m_c × n) with SVD A = U Σ Vᵀ, the left singular vectors u_k whose singular value σ_k ≈ 0 span the left null space — the row combinations u_kᵀ A ≈ 0 that vanish. Row i’s participation in that null space, w_i = Σ_{k : σ_k ≤ τ} u[i,k]² ∈ [0, 1], localizes the dependency to specific equations (w_i = 1 ⇒ row i lies entirely in the null space). The REPL resolves the implicated rows to model names via the same .row path as print equation.

Structs§

RankCulprit
One row implicated in the Jacobian’s near-null space, with its participation weight Σ_{k∈null} u[i,k]² ∈ [0, 1].
RankReport
Numerical rank diagnosis of the active-constraint Jacobian at one iterate. See the module docs for the underlying SVD analysis.
RankRow
Identity of one active row in a RankReport, so the REPL can resolve it to a model name (the equality name pool for ResidKind::Eq, the inequality pool for ResidKind::Ineq).