-------------------------------------------------------------------- We assume that the current directory is SDPT3-3.02 Example 1 -------------------------------------------------------------------- >> startup %% need only to run this file once >> C{1} = [1 0; 0 1]; >> At{1,1} = [0 1; 1 0]; >> At{1,2} = [1 1; 1 1]; >> b = [1; 2]; >> blk{1,1} = 's'; blk{1,2} = 2; >> [obj,X,y,Z] = sqlp(blk,At,C,b); solution: y = [1.1919; -0.0950] X{1} = [0.5 0.5 ; 0.5 0.5 ]; Z{1} = [1.0950 -1.0950; -1.0950 1.0950]; -------------------------------------------------------------------- Example 2. Data with block diagonal structure. -------------------------------------------------------------------- C{1} = [ 0 0 0 0; 0 0 0 0; 0 0 1 2; 0 0 2 1]; At{1,1} = [ 1 0 0 0; 0 1 0 0; 0 0 0 0; 0 0 0 0]; At{1,2} = [ 1 0 0 0; 0 0 0 0; 0 0 1 0; 0 0 0 0]; At{1,3} = [ 0 1 0 0; 1 0 0 0; 0 0 0 1; 0 0 1 0]; At{1,4} = [ 0 0 0 0; 0 1 0 0; 0 0 0 0; 0 0 0 1]; b = [1; 1; 1; 1]; blk{1,1} = 's'; blk{1,2} = [2 2]; [obj,X,y,Z] = sqlp(blk,At,C,b); -------------------------------------------------------------------- Example 3. Data with block diagonal structure. -------------------------------------------------------------------- C{1} = sparse([ 0 0; 0 0]); C{2} = sparse([ 1 2 1;2 1 0; 1 0 1]); At{1,1} = sparse([ 1 0; 0 1]); At{1,2} = sparse([ 1 0; 0 0]); At{1,3} = sparse([ 0 1; 1 0]); At{1,4} = sparse([ 0 0; 0 1]); At{2,1} = sparse([ 0 0 0; 0 1 0; 0 0 1]); At{2,2} = sparse([ 1 0 1; 0 0 0; 1 0 1]); At{2,3} = sparse([ 0 2 0; 2 0 -1; 0 -1 0]); At{2,4} = sparse([ 0 0 0; 0 5 0; 0 0 5]); b = [1; 1; 1; 1]; blk{1,1} = 's'; blk{1,2} = [2]; blk{2,1} = 's'; blk{2,2} = [3]; [obj,X,y,Z] = sqlp(blk,At,C,b); -------------------------------------------------------------------- The following example shows how to call a data file that is stored in SDPA format. We use the example file provided in the subdirectory /sdpib. -------------------------------------------------------------------- >> [blk,At,C,b] = read_sdpa('./sdplib/theta3.dat-s'); >> [obj,X,y,Z] = sqlp(blk,At,C,b); -------------------------------------------------------------------- The following example shows how to call a data file that is stored in SeDuMi format. We use the example file provided in the subdirectory /dimacs. -------------------------------------------------------------------- >> [blk,At,C,b] = read_sedumi('./dimacs/hamming_7_5_6.mat'); >> [obj,X,y,Z] = sqlp(blk,At,C,b); --------------------------------------------------------------------