Error in cvxprob/eliminate

#1

Hi all, here is the buggy code:

cvx_begin
variables c x(13) Y(13,13,m);
expressions K(12,12) A_0(13,13) D(13,13) S(13,13);
minimize(c)
subject to

for i=1:m
   S=S+Y(:,:,i);
end
for k=1:m
   [Y(:,:,k) A(:,:,k);A(:,:,k) A_0]==semidefinite(26);
end

A_0==semidefinite(13);
C*A_0-S==semidefinite(13);
cvx_end

I omit the definition of A_0 and C for clarity. Whenever I run it (let’s call it ProgramA), it returns the following error:

Index exceeds matrix dimensions.

Error in cvxprob/eliminate (line 200)
n_save = nnz(sum(dbCA(:,ineqs~=0)~=0,1)==1+(dbCA(1,ineqs~=0)~=0));

Error in cvxprob/solve (line 17)
[ At, cones, sgn, Q, P, dualized ] = eliminate( prob, true, shim.dualize );

Error in cvx_end (line 79)
    solve( prob );

Error in ProgramA (line 65)
cvx_end

Please do believe me that the third dimension of A(:,:,:slight_smile: is m (ie. there are really m A(:,:,i)). I found a weird thing. If in the for loop wrapping the semidefinite constraints, the upper index is reduced to m-1 from m, or if I delete the constraint “C*A_0-S==semidefinite(13);”, then it runs normally.

Thanks in advance for any possible answer.

Error: inner matrix dimension must agree in cvxprob/eliminate
(Michael C. Grant) #2

Looks like a bug. You should submit this to http://support.cvxr.com

#3

I also encountered a similar error message when adding the following conic constraints:

variable x(numUsers);
variable z(numUsers);
variable w(numUsers);
for idx_user = 1:numUsers 
       z(idx_user) + w(idx_user) == - ee * x(idx_user);
end
norm(z,1) + C * norm(w,2) <= Imax - ChannelGainsHat'*x;

The problem is in the last line of code. Below is the error message:

Error using  
Inner matrix dimensions must agree.
Error in cvxprob/eliminate (line 131)
            P       = P * cvx_invert_structure( xR );
Error in cvxprob/solve (line 17)
[ At, cones, sgn, Q, P, dualized ] = eliminate( prob, true, shim.dualize );
Error in cvx_end (line 79)
        solve( prob );
Error in solve_parametric (line 97)
cvx_end

Could you please suggest a workaround? Thank you!