I want to achieve the constraint: norm(A) <= 1, where A is a matrix variable.
M = Model(SCS.Optimizer)
@variable(M,A[1:3,1:3])
@constraint(M, [1; A] in SecondOrderCone())
But it shows error:@constraint(M, [1; A] in SecondOrderCone())
: Unrecognized constraint building format. Tried to invoke build_constraint(error, GenericAffExpr{Float64,VariableRef}[1 1 1; A[1,1] A[1,2] A[1,3]; A[2,1] A[2,2] A[2,3]; A[3,1] A[3,2] A[3,3]], SecondOrderCone())
, but no such method exists. This is due to specifying an unrecognized function, constraint set, and/or extra positional/keyword arguments.
If you’re trying to create a JuMP extension, you need to implement build_constraint
to accomodate these arguments.
How to implement build_constraint
? Or is any way to achieve the L2 norm of a matrix xx is smaller than 1 in JuMP?