Hello,
My matrix P is here:
I know my matrix is too big but I have to solve it. However, when I run the code, I am waiting too much and I cannot see the result because generally it just crashes. How can I make it faster?
Here is my code
function [G,B] = DI_PP2(P_exp,k)
d = size(P_exp,1);
m = size(P_exp,3);
key=1;
cvx_begin
variable P(d,d,m,m,d);
dual variables T{d,d,m,m} lambda
G=cvx(0);
for e=1:d
for b=1:d
G=G+P(e,b,key,1,e);
end
end
minimize (-G)
subject to
for e=1:d
NPAHierarchy_unnormalized(P(:,:,:,:,e),k)==1;
end
for x=1:m
for y=1:m
for a=1:d
for b=1:d
squeeze(sum(P(a,b,x,y,:),5))==P_exp(a,b,x,y) : T{a,b,x,y};
end
end
end
end
sum(sum(sum(P(:,:,:,:,:),1),2),5)==1 : lambda;
cvx_end
B=cell2mat(T);
G=double(G)