%given a reduced interval matrix with nonnegative entries %the program tells whether it contains a rk 1 matrix; the positive answer %corresponds to 1, the negative one to 0 % The program uses Theorem 10 of the paper On rank range of interval matrices function l=rk1nnr(m,M) l=1; [p,q]=size(m); c=min(p,q); t=c-1; for h=2:2^t %%%%%%%%%scelto h%%%%%%%%%%%%%%%%%%%%%%%%%%%%% X=multisubsets(p,h); Y=orderedmultisubsets(q,h); for a=1:size(X,1) for b=1:size(Y,1) d=1; for i=1:h d=d*m(X(a,i),Y(b,i)); end %so I have calculated m_{X(a), Y(b)} P=perms(Y(b,:)); for j=1:size(P,1) e=1; for i=1:h e=e*M(X(a,i),P(j,i)); end %so we have calculated M_{X(a), j-th permutation of Y(b)} if d > e l=0; return end end %j=1:size(P,2) end %for a end %for b %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% end %for h=2:2^t