# Introduce unsquare slack matrix variables in SDP Programming Mode constraint

(Jack Nguyen) #1

Hi all,
My problem is in SDP programming mode. I have one constraint which is min(…) > threshold. So I formulate the problem and introduce slack variable as follows
cvx_begin sdp
variable X(M, N) nonnegative; <-slack variables
variable Q(:, :, : ) hermitian semidefinite;
variable eta nonnegative;

``````    maximize( eta )
subject to

for m=1:M
tmp = cvx(zeros(1,1));
for n=1:N
... >=  X(m, n);
X(m, n)  >= threshold;
end
tmp = tmp + X(m, n);
end
...
``````

cvx_end
However, CVX does not accept with an error “SDP constraint must be square.” Exactly the error comes from X(M,N) due to wrong declare. So how can I reformulate the slack variable X(M,N) to obtain the constraint min(…) >= threhold?
Thanks so much

(Mark L. Stone) #2

I don’t understand what you’re doing. What is `...` in `... >= X(m, n);` ?

Inequality constraints involving non-square matrices are disallowed; attempting to use them causes an error. If you wish to do true elementwise comparison of matrices X and Y, use a vectorization operation `X(:) <= Y(:)` or `vec( X ) <= vec( Y ).` (vec is a function provided by CVX that is equivalent to the colon operation.)