Home > solver > DSA_BD_SDP_Solver.m

DSA_BD_SDP_Solver

PURPOSE ^

SDP_Solver: solve an semidefinite-linear program with DSA-BD method.

SYNOPSIS ^

function [obj,X,y,Z,runhist] = DSA_BD_SDP_Solver(blk,At,C,b,OPTIONS,X0,y0,Z0)

DESCRIPTION ^

 SDP_Solver: solve an semidefinite-linear program with DSA-BD method.
%
%  [obj,X,y,Z,runhist] = SDP_Solver(blk,At,C,b,OPTIONS,X0,y0,Z0);
%
%  Input: blk: a cell array describing the block diagonal structure.
%          At: a cell array with At{p} = [svec(Ap1) ... svec(Apm)]
%         b,C: data for the SDP instance.
%  (X0,y0,Z0): an initial iterate
%     OPTIONS: a structure that specifies parameters required in DSA_BD.m,
%              (if it is not given, the default in DSA_BD_parameters.m is used).
%
%  Output: obj  = [<C,X> <b,y>].
%          (X,y,Z): an approximately optimal solution or a primal or dual
%                   infeasibility certificate.
%          runhist: values measuring the progress of the algorithm
%-------------------------------------------------------------------------
%*************************************************************************
% C. Ortiz
% Last Modified: 3/31/2011
%*************************************************************************

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % SDP_Solver: solve an semidefinite-linear program with DSA-BD method.
0002 %%
0003 %%  [obj,X,y,Z,runhist] = SDP_Solver(blk,At,C,b,OPTIONS,X0,y0,Z0);
0004 %%
0005 %%  Input: blk: a cell array describing the block diagonal structure.
0006 %%          At: a cell array with At{p} = [svec(Ap1) ... svec(Apm)]
0007 %%         b,C: data for the SDP instance.
0008 %%  (X0,y0,Z0): an initial iterate
0009 %%     OPTIONS: a structure that specifies parameters required in DSA_BD.m,
0010 %%              (if it is not given, the default in DSA_BD_parameters.m is used).
0011 %%
0012 %%  Output: obj  = [<C,X> <b,y>].
0013 %%          (X,y,Z): an approximately optimal solution or a primal or dual
0014 %%                   infeasibility certificate.
0015 %%          runhist: values measuring the progress of the algorithm
0016 %%-------------------------------------------------------------------------
0017 %%*************************************************************************
0018 %% C. Ortiz
0019 %% Last Modified: 3/31/2011
0020 %%*************************************************************************
0021 
0022 function [obj,X,y,Z,runhist] = DSA_BD_SDP_Solver(blk,At,C,b,OPTIONS,X0,y0,Z0)
0023 
0024 %%
0025 %%-----------------------------------------
0026 %% get parameters from the OPTIONS structure.
0027 %%-----------------------------------------
0028 %%
0029 warning off;
0030 
0031 matlabversion = sscanf(version,'%f');
0032 
0033 par = DSA_BD_Parameters;
0034 if strcmp(computer,'PCWIN64') | strcmp(computer,'GLNXA64')
0035     par.computer = 64;
0036 else
0037     par.computer = 32;
0038 end
0039 par.matlabversion = matlabversion(1);
0040 par.tstart = clock;
0041 par = DSA_BD_Parameters;
0042 
0043 %%
0044 if exist('OPTIONS')
0045     if isfield(OPTIONS,'vers');                           par.vers                        = OPTIONS.vers; end
0046     if isfield(OPTIONS,'maxit');                          par.maxit                       = OPTIONS.maxit; end
0047     if isfield(OPTIONS,'sigma');                          par.sigma                       = OPTIONS.sigma; end
0048     if isfield(OPTIONS,'tol');                            par.tol                         = OPTIONS.tol; end
0049     if isfield(OPTIONS,'normalize');                      par.normalize                   = OPTIONS.normalize; end
0050     if isfield(OPTIONS,'adaptivelambda');                 par.adaptivelambda              = OPTIONS.adaptivelambda; end
0051     if isfield(OPTIONS,'dynamicscaling');                 par.dynamicscaling              = OPTIONS.dynamicscaling; end
0052     if isfield(OPTIONS,'scaleratio');                     par.scaleratio                  = OPTIONS.scaleratio; end
0053     if isfield(OPTIONS,'scalecorrection');                par.scalecorrection             = OPTIONS.scalecorrection; end
0054     if isfield(OPTIONS,'dyn_scale_updateiteration');      par.dyn_scale_updateiteration   = OPTIONS.dyn_scale_updateiteration; end
0055     if isfield(OPTIONS,'adaptiveiteration');              par.adaptiveiteration           = OPTIONS.adaptiveiteration; end
0056     if isfield(OPTIONS,'print');                          par.print                       = OPTIONS.print; end
0057     if isfield(OPTIONS,'n');                              par.n                           = OPTIONS.n; end
0058     if isfield(OPTIONS,'m');                              par.m                           = OPTIONS.m; end
0059     if isfield(OPTIONS,'balancedinit');                   par.balancedinit                = OPTIONS.balancedinit; end
0060     if isfield(OPTIONS,'file');                           par.file                        = OPTIONS.file; end
0061     if isfield(OPTIONS,'tstart');                         par.tstart                      = OPTIONS.tstart; end
0062     if isfield(OPTIONS,'scalerelnorm');                   par.scalerelnorm                = OPTIONS.scalerelnorm; end
0063 end
0064 if (size(blk,2) > 2); par.smallblkdim = 0; end
0065 
0066 
0067 
0068 %%-----------------------------------------
0069 %% convert matrices to cell arrays.
0070 %%-----------------------------------------
0071 %%
0072 if ~iscell(At); At = {At}; end;
0073 if ~iscell(C);  C = {C}; end;
0074 if all(size(At) == [size(blk,1), length(b)]);
0075     convertyes = zeros(size(blk,1),1);
0076     for p = 1:size(blk,1)
0077         if strcmp(blk{p,1},'s') && all(size(At{p,1}) == sum(blk{p,2}))
0078             convertyes(p) = 1;
0079         end
0080     end
0081     if any(convertyes)
0082         if (par.printlevel);
0083             fprintf('\n sqlp: converting At into required format');
0084         end
0085         At = svec(blk,At,ones(size(blk,1),1));
0086     end
0087 end
0088 %%
0089 %%-----------------------------------------
0090 %% main solver
0091 %%-----------------------------------------
0092 %%
0093 
0094 [obj,X,y,Z,runhist] = ...
0095     DSA_BD(blk,At,C,b,par,X0,y0,Z0);
0096 end
0097

Generated on Mon 19-Sep-2011 21:41:33 by m2html © 2005