Skip to content

Add tolerance to is_posdef. - #130

Merged
stephane-caron merged 1 commit into
qpsolvers:mainfrom
darnstrom:strict-posdef
Apr 17, 2026
Merged

Add tolerance to is_posdef.#130
stephane-caron merged 1 commit into
qpsolvers:mainfrom
darnstrom:strict-posdef

Conversation

@darnstrom

Copy link
Copy Markdown
Contributor

This PR adds a tolerance to the positive-definite check in is_posdef to filter out QPs which have Hessians that are numerically singular.
For example, the problem "TAME" in the MM testset is classified as positive definite, but it has the Hessian

$$ P = \begin{bmatrix} 2 & -2 \\ -2 & 2 \end{bmatrix}, $$

which is clearly singular. Numerically the singular eigenvalue evaluates to ~1e-16, and since is_posdef currently simply compares >0, the problem is classified as posef.

@stephane-caron
stephane-caron merged commit 0559f80 into qpsolvers:main Apr 17, 2026
14 checks passed
@stephane-caron

Copy link
Copy Markdown
Member

Makes sense, thank you for this fix 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants