@SDconstraint not working


I’m new to Julia and this might be something very simple but I’m struggling to implement in JuMP.

julia> using JuMP

julia> using MosekTools

julia> model = Model();

julia> @variable(model, x)

julia> a = [x 2x
                   0  x];

julia> b = [1 2
                  3 4];

julia> cref = @SDconstraint(model, a ⪰ b)
ERROR: UndefVarError: @SDconstraint not defined

What am I doing wrong here? This is borrowed from an example given here

1 Like

You’ve stumbled upon some very old documentation that isn’t maintained by us.

Here’s the official documentation: Introduction · JuMP

Here’s some links to get you started:

Your example would be:

using JuMP
using MosekTools
model = Model(Mosek.Optimizer);
@variable(model, x)
a = [x 2x; 0 x];
b = [1 2; 3 4];
@constraint(model, a >= b, PSDCone())
1 Like

Thanks a lot! This worked for me! :smiley:

1 Like