Sparse Matrix on CVX


(navro) #1

Hello,
Im working my thesis on an energy disaggregation problem via powerlets and i want CVX for a sparse matrix.Now im new in CVX and after reading many forums here i wonder if what i want is even possible.This is my code so far:
cvx_begin

variable Z(a,b)  sparse

for i = 1 : 98 :2      
    minimize((g *norm(Z(i,:),Inf))+ (gg * norm(Z(:,i)-Z(:,i+1))) + (trace(D'*Z)))
    subject to
        Z >= 0
        A'*Z==B
end

cvx_end
Is there is a way to define a sparse matrix via cvx?
Thanks


(Mark L. Stone) #2

You can apply sparse to a CVX variable or expression, but I don’t think it does anything.

help cvx/sparse

Disciplined convex/geometric programming information for sparse:
    For a CVX variable X, sparse(X) just returns X. In the three-
    and five-argument versions sparse(I,J,V,M,N), the index
    arguments I and J and size arguments M and N must be constant.
    If any of the index pairs (I(k),J(k)) are repeated, then the
    corresponding elements V(k) will be added together. Therefore,
    those elements must be compatible with addition; i.e., they
    must have the same curvature.