Skip to content
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

1-by-1 matrix PSD constraint #85

Closed
thinh-le opened this issue Jan 26, 2022 · 1 comment
Closed

1-by-1 matrix PSD constraint #85

thinh-le opened this issue Jan 26, 2022 · 1 comment

Comments

@thinh-le
Copy link

using JuMP, MosekTools

m = JuMP.Model(Mosek.Optimizer)
@variable(m, x)
@objective(m, Min, 1+x)
M = reshape([x],1,1)
@constraint(m, M in PSDCone())
optimize!(m)

ERROR: Invalid dimension for semidefinite constraint, got 1 which is smaller than the minimum dimension 2.
Stacktrace:

This can be fixed at the level of JuMP, for example:

length(M) == 1 ? @constraint(m, M[1,1] >= 0) : @constraint(m, M in PSDCone())

but perhaps a fix with MosekTools would give better user experience?

@ulfworsoe
Copy link
Contributor

A one-dimensional PSD cone is just a linear variable, so it should be a valid construction. I'll see about fixing it in MosekTools.

ulfworsoe added a commit to ulfworsoe/MosekTools.jl that referenced this issue Feb 8, 2022
ulfworsoe added a commit to ulfworsoe/MosekTools.jl that referenced this issue Feb 8, 2022
@blegat blegat closed this as completed in 7a9807f Mar 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants