-
-
Notifications
You must be signed in to change notification settings - Fork 396
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inequality constraints over symmetric matrices are cumbersome #3765
Comments
We can probably make this work @constraint(model, Symmetric(A) == Symmetric(B)) by adding something like function build_constraint(error_fn, Q::Symmetric, set::Union{Zeros,Nonnegatives,Nonpositives})
n = LinearAlgebra.checksquare(Q)
shape = SymmetricMatrixShape(n)
return VectorConstraint(
vectorize(Q, shape),
set,
shape,
)
end For the inequality, I'd prefer an explicit: @constraint(model, Symmetric(A) >= Symmetric(B), Nonnegatives()) because most user would actually expect a PSD constraint, not elementwise inequality when you do an inequality between matrices so it would be too confusing to make it work without the extra argument. Lines 575 to 582 in 56b186f
Adding the build_constraint I suggest above wouldn't distinguish between the case where Nonnegatives is added explicitly. We would need a way to distinguish it before allow Nonnegatives in build_constraint .
|
Err, note that for equality, it already works.
Without ever having used the PSD side of things, |
Agreed. We discussed this, see #3281 (comment)
👍 this solves a lot of issues.
There is no such thing as the "wrong" set. The constraint is rewritten to |
What i mean is, there's both the inequality comparison between
But what would |
See https://jump.dev/JuMP.jl/stable/manual/constraints/#Set-inequality-syntax The set defines the partial ordering of
|
Oh wow, that is the most exquisite design decision (strictly from the user-facing view, |
I might be misinterpreting your comment, but this is not a design decision that is unique to JuMP. It follows from the syntax for the generalized inequality of a cone: See, e.g., Section 2.4.1 of Boyd and Vandenberghe. |
It is more that i'm failing to fully convey my point :)
Yes, but that's Anyways, that would be better than nothing i suppose :) |
Unless i'm missing something very obvious, there is no nice way to exploit the symmetry of matrices
(to avoid adding duplicate constraints) when using
<=
and>=
constraints.Here's what i've tried:
It seems to be it's a bit too brittle, no?
I would have guessed there should be
Nonnegatives
/Nonpositives
sets,similar to the existing
Zeros
argument-less set, and such comparisonsbetween symmetric matrices should work similarly with equality-comparison.
The text was updated successfully, but these errors were encountered: