From 7565f6e071a984fcb4cca5cef100d440c34eb563 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Legat?= Date: Sat, 19 Jan 2019 17:25:33 +0100 Subject: [PATCH] Fix @SDconstraint with import --- src/macros.jl | 2 +- test/hygiene.jl | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/macros.jl b/src/macros.jl index 9b9c5c47e55..91a19979141 100644 --- a/src/macros.jl +++ b/src/macros.jl @@ -651,7 +651,7 @@ function parseSDconstraint(_error::Function, sense::Symbol, lhs, rhs) _error("Invalid sense $sense in SDP constraint") end vectorized = false - parsecode, buildcall = parse_one_operator_constraint(_error, false, Val(:in), aff, :(PSDCone())) + parsecode, buildcall = parse_one_operator_constraint(_error, false, Val(:in), aff, :(JuMP.PSDCone())) vectorized, parsecode, buildcall end diff --git a/test/hygiene.jl b/test/hygiene.jl index a79c473dfea..1865e41979c 100644 --- a/test/hygiene.jl +++ b/test/hygiene.jl @@ -27,6 +27,8 @@ JuMP.@constraints(model, begin sum( y[j] for j=r if j == 4) <= 1 end) +JuMP.@SDconstraint(model, [x x; -x x] ⪰ 0) + JuMP.@objective(model, sense, y[4]) JuMP.@objective(model, Min, x + sum( j*y[j] for j=r )) JuMP.@objective(model, Max, sum( y[j] for j=r if j == 4))