clear all
%INPUT:
  %%  m    number of constraints
  %%  n    dimension of variable matrices X,Z
  %%  dualHasInteriorFlag   1 forces dual strict feasibility, 0 otherwise
m=5;
n=20;
dualHasInteriorFlag=1;   % for dual strict feasibility
%%%dualHasInteriorFlag=0;   % ignoring dual strict feasibility
%%%%%%%%%%%%%%%%
%%% Note that ***NoP+NoD+gap=n*** must hold.
NoP=0;
NoD=0;
gap=0;
while (NoP*NoD ==0),
   disp(['inside while values m,n,gap,NoP,NoD:  ',num2str([m n gap NoP NoD])]);
   gap=round(rand*n);
   NoP=round(rand*(n-gap));
   NoD=n-gap-NoP;
end
disp(['       FINAL values m,n,gap,NoP,NoD:  ',num2str([m n gap NoP NoD])]);
if dualHasInteriorFlag==1,
    disp('dualHasInteriorFlag is 1, forces dual strict feasibility');
else
    disp('dualHasInteriorFlag is 0, ignores dual strict feasibility');
end
[A, b, C, X, y, Z, status] = ...
           genHardSDP(m, n, gap, NoP, NoD, dualHasInteriorFlag);
%
% Write out the problem in .dat-s format.
%
keyboard
disp(' ')
disp('Changing matlab format to SeDuMi format into c and AT');
disp(' c=reshape(C,n*n,1); AT(i,:)=reshape(A{i},1,n*n);')
c=reshape(C,n*n,1);
for i=1:m
  AT(i,:)=reshape(A{i},1,n*n);
end
disp('write SeDuMi data in .dat-s format into file prob.dat-s using writesdpa.m')
K.s=n;
writesdpa('prob.dat-s',AT,b,c,K);
!chmod o+r prob.dat-s
