next up previous contents
Next: A problem with Up: Examples Previous: A randomly generated

Artificially generated problems

>> 
>> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>> % Examples of artificially generated problems
>> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>> 
>> blk = [20 10 5];
>> m = 20;
>> nosfeas        % generate problem with no strictly feasible primal point
>> setpars
>> scalefac = 1;  % X0 = Z0 = I fine for random problems
>> initvars
>> prtlevel = 0;  % disable printing of iterates
>> sdp

tau =   0.9990,     scalefac =        1

sdp: elapsed time               =  13.92766 seconds
sdp: elapsed cpu time           =  13.54000 seconds
sdp: flops                      =   5.47805e+07
sdp: Number of iterations       =   20
sdp: final value of X.Z         =   3.829e-08
sdp: final primal infeasibility =   1.300e-12
sdp: final dual infeasibility   =   7.451e-09
sdp: primal objective value     =  -5.9560845828366151e+00
sdp: dual objective value       =  -5.9560846207436846e+00

>> blk = 10;
>> m = 50;
>> r = 2;         % choose primal solution rank and
>> s = 7;         % dual solution rank in advance
>> makesdp        % generated so solution is primal degenerate

 makesdp: strict complementarity violated

 makesdp: primal nondegeneracy violated
>> 
>> initvars
>> prtlevel = 0;
>> sdp

tau =   0.9990,     scalefac =        1


sdp: elapsed time               =   1.30246 seconds
sdp: elapsed cpu time           =   1.26000 seconds
sdp: flops                      =   6.23466e+06
sdp: Number of iterations       =    6
sdp: final value of X.Z         =   1.129e-11
sdp: final primal infeasibility =   2.350e-11
sdp: final dual infeasibility   =   6.537e-14
sdp: primal objective value     =   1.2626520565210694e+01
sdp: dual objective value       =   1.2626520565144881e+01
>> 
>> [sort(blkeig(X,blk))  -sort(blkeig(-Z,blk))]   % sorted eigenvalues

ans =

   2.0190e-14   3.0311e+00
   4.2094e-13   1.7728e+00
   8.8589e-13   1.2308e+00
   1.0784e-12   1.0751e+00
   1.1413e-12   9.7008e-01
   1.4416e-12   7.9179e-01
   1.5300e-12   7.6035e-01
   2.2363e-12   6.2020e-01
   5.1329e-02   3.1152e-11
   6.7871e-01   1.8835e-12

>> 
>> % note that convergence took place to a strictly complementary solution
>> 
>> primalcond(A,blk,X,1.0e-06); % confirms that solution is primal degenerate
primalcond =         Inf
>> 
>> dualcond(A,blk,Z,1.0e-06);   % check if dual degenerate
dualcond =   2.931e+00
>> 
>> sdpcond(A,b,C,blk,X,y,Z);    % confirms that SDP condition number is infinite, 

sdpcond: gap                      =   1.129e-11
sdpcond: primal infeasibility     =   2.350e-11
sdpcond: dual infeasibility       =   6.537e-14
sdpcond: cond estimate of 3x3 block matrix =   2.220e+15
>>                              % since SDP is degenerate



Madhu Nayakkankuppam
Fri Mar 28 00:48:56 EST 1997