Skip to content

Commit

Permalink
Initial merge of latest SDPT3 source from authors
Browse files Browse the repository at this point in the history
  • Loading branch information
mcg1969 committed May 7, 2017
1 parent ccbd498 commit bc93ea8
Show file tree
Hide file tree
Showing 132 changed files with 1,207 additions and 1,219 deletions.
19 changes: 19 additions & 0 deletions Citation
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
SDPT3 Version 4.0
A MATLAB software for semidefinite-quadratic-linear programming
Copyright (c) 1997 by
Kim-Chuan Toh, Michael J. Todd, and Reha H. Tutuncu

If you find this software useful for your work, please cite the
followings:

[1] K.C. Toh, M.J. Todd, and R.H. Tutuncu,
SDPT3 --- a Matlab software package for semidefinite programming,
Optimization Methods and Software, 11 (1999), pp. 545--581.
[2] R.H Tutuncu, K.C. Toh, and M.J. Todd,
Solving semidefinite-quadratic-linear programs using SDPT3,
Mathematical Programming Ser. B, 95 (2003), pp. 189--217.





16 changes: 1 addition & 15 deletions Copyright
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ A MATLAB software for semidefinite-quadratic-linear programming
Copyright (c) 1997 by
Kim-Chuan Toh, Michael J. Todd, and Reha H. Tutuncu

This version of SDPT3 is distributed under the GNU General Public License 2.0.
This version of the above software is distributed under the GNU General Public License 2.0.

For commercial applications that may be incompatible with this license,
please contact the authors to discuss alternatives.
Expand All @@ -17,17 +17,3 @@ This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.


*** Citation Information
If you find this software useful, please cite it in you publication as
follows:

K.C. Toh, M.J. Todd, and R.H. Tutuncu,
SDPT3 --- a Matlab software package for semidefinite
programming, version 1.3,
Optimization Methods and Software, 11 (1999), pp. 545--581.




10 changes: 5 additions & 5 deletions Examples/Asum.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
%%
%% output: Ay = sum_{k=1}^m y(k)*Ak, a column CELL ARRAY
%% with the same structure as A{:,1}.
%%
%% SDPT3: version 3.0
%%*****************************************************************
%% SDPT3: version 4.0
%% Copyright (c) 1997 by
%% K.C. Toh, M.J. Todd, R.H. Tutuncu
%% Last Modified: 2 Feb 01
%%*************************************************************
%% Kim-Chuan Toh, Michael J. Todd, Reha H. Tutuncu
%% Last Modified: 16 Sep 2004
%%*****************************************************************

function Ay = Asum(blk,A,y)

Expand Down
13 changes: 6 additions & 7 deletions Examples/Doptdesign.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%%*******************************************************
%%*****************************************************************
%% Doptdesign: D-optimal experiment design.
%%
%% max log(det(sum_{i=1}^p lambda_i v_i v_i^T)) + const
Expand All @@ -10,13 +10,12 @@
%% lambda: lambda_i is the fraction of the experiments
%% allocated to test vector v_i.
%% S: = V*diag(lambda)*V'.
%%
%%
%% SDPT3: version 3.0
%%*****************************************************************
%% SDPT3: version 4.0
%% Copyright (c) 1997 by
%% K.C. Toh, M.J. Todd, R.H. Tutuncu
%% Last modified: 2 Feb 01
%%*******************************************************
%% Kim-Chuan Toh, Michael J. Todd, Reha H. Tutuncu
%% Last Modified: 16 Sep 2004
%%*****************************************************************

function [blk,At,C,b,OPTIONS,lambda,bblk,AAt] = Doptdesign(V,solve);

Expand Down
102 changes: 53 additions & 49 deletions Examples/ToeplitzApprox.m
Original file line number Diff line number Diff line change
@@ -1,49 +1,53 @@
%%*************************************************************************
%% ToeplitzApprox: find the nearest symmetric positive definite Toeplitz
%% matrix to a given symmetric matrix F.
%%
%%
%% max -y(n+1)
%% s.t. T(y(1:n)) + y(n+1)*B >= 0
%% [I 0 ] + sum_{k=1}^n y(k) [0 gam(k)*e_k ] + y(n+1)*B >= 0
%% [0 -beta] [gam(k)*e_k' -2q(k) ]
%%
%% where B = diag([zeros(n,1); 1])
%% q(1) = - Tr(F); q(k+1) = -sum of upper and lower kth diagonals of F
%% gam(1) = sqrt(n); gam(k) = sqrt(2*(n-k+1)) for k=2:n
%% beta = norm(F,'fro')^2
%%*************************************************************************

function [blk,At,C,b] = ToeplitzApprox(F)

n = length(F);
gam = sqrt([n, 2*(n-1:-1:1)]);
q = zeros(n,1);
q(1) = -sum(diag(F));
for k=1:n-1
q(k+1) = -2*sum(diag(F,k));
end
beta = norm(F,'fro')^2;

blk{1,1} = 's'; blk{1,2} = n+1;
blk{2,1} = 's'; blk{2,2} = n+1;

b = [zeros(n,1); -1];
C{1,1} = sparse(n+1,n+1);
C{2,1} = spdiags([ones(n,1); -beta],0,n+1,n+1);

Acell = cell(1,n+1);
Acell{1} = -spdiags([ones(n,1); 0],0,n+1,n+1);
for k = 1:n-1
tmp = -spdiags([ones(n,1); 0],k,n+1,n+1);
Acell{k+1} = tmp + tmp';
end
Acell{n+1} = -spconvert([n+1,n+1,1]);
At(1,1) = svec(blk(1,:),Acell,1);

for k = 1:n
Acell{k} = -spconvert([k, n+1, gam(k); n+1, k, gam(k); n+1, n+1, -2*q(k)]);
end
Acell{n+1} = -spconvert([n+1,n+1,1]);
At(2,1) = svec(blk(2,:),Acell,1);
%%***********************************************************************
%%*************************************************************************
%% ToeplitzApprox: find the nearest symmetric positive definite Toeplitz
%% matrix to a given symmetric matrix F.
%%
%% max -y(n+1)
%% s.t. T(y(1:n)) + y(n+1)*B >= 0
%% [I 0 ] + sum_{k=1}^n y(k) [0 gam(k)*e_k ] + y(n+1)*B >= 0
%% [0 -beta] [gam(k)*e_k' -2q(k) ]
%%
%% where B = diag([zeros(n,1); 1])
%% q(1) = - Tr(F); q(k+1) = -sum of upper and lower kth diagonals of F
%% gam(1) = sqrt(n); gam(k) = sqrt(2*(n-k+1)) for k=2:n
%% beta = norm(F,'fro')^2
%%*****************************************************************
%% SDPT3: version 4.0
%% Copyright (c) 1997 by
%% Kim-Chuan Toh, Michael J. Todd, Reha H. Tutuncu
%% Last Modified: 16 Sep 2004
%%*****************************************************************

function [blk,At,C,b] = ToeplitzApprox(F)

n = length(F);
gam = sqrt([n, 2*(n-1:-1:1)]);
q = zeros(n,1);
q(1) = -sum(diag(F));
for k=1:n-1
q(k+1) = -2*sum(diag(F,k));
end
beta = norm(F,'fro')^2;

blk{1,1} = 's'; blk{1,2} = n+1;
blk{2,1} = 's'; blk{2,2} = n+1;

b = [zeros(n,1); -1];
C{1,1} = sparse(n+1,n+1);
C{2,1} = spdiags([ones(n,1); -beta],0,n+1,n+1);

Acell = cell(1,n+1);
Acell{1} = -spdiags([ones(n,1); 0],0,n+1,n+1);
for k = 1:n-1
tmp = -spdiags([ones(n,1); 0],k,n+1,n+1);
Acell{k+1} = tmp + tmp';
end
Acell{n+1} = -spconvert([n+1,n+1,1]);
At(1,1) = svec(blk(1,:),Acell,1);

for k = 1:n
Acell{k} = -spconvert([k, n+1, gam(k); n+1, k, gam(k); n+1, n+1, -2*q(k)]);
end
Acell{n+1} = -spconvert([n+1,n+1,1]);
At(2,1) = svec(blk(2,:),Acell,1);
%%***********************************************************************
87 changes: 46 additions & 41 deletions Examples/ToeplitzApproxSQQ.m
Original file line number Diff line number Diff line change
@@ -1,42 +1,47 @@
%%*************************************************************************
%% ToeplitzApproxSQQ: find the nearest symmetric positive definite Toeplitz
%% matrix to a given symmetric matrix F.
%%
%% max -y0
%% s.t. y0*B + T(y) (S>=) 0
%% [y0; gam.*y] + [0; q./gam] (Q>=) 0
%%
%% where B = diag([zeros(n,1); 1])
%% q(1) = - Tr(F); q(k+1) = -sum of upper and lower kth diagonals of F
%% gam(1) = sqrt(n); gam(k) = sqrt(2*(n-k+1)) for k=2:n
%%*************************************************************************

function [blk,At,C,b] = ToeplitzApproxSQQ(F)

n = length(F);
gam = sqrt([n, 2*(n-1:-1:1)]');
q = zeros(n,1);
q(1) = -sum(diag(F));
for k=1:n-1
q(k+1) = -2*sum(diag(F,k));
end
beta = norm(F,'fro')^2;

blk{1,1} = 's'; blk{1,2} = n+1;
blk{2,1} = 'q'; blk{2,2} = n+1;

b = [-1; zeros(n,1)];
C{1,1} = sparse(n+1,n+1);
C{2,1} = [0; q./gam];

Acell = cell(1,n+1);
Acell{1} = -spconvert([n+1,n+1,1]);
Acell{2} = -spdiags([ones(n,1); 0],0,n+1,n+1);
for k = 1:n-1
tmp = -spdiags([ones(n,1); 0],k,n+1,n+1);
Acell{k+2} = tmp + tmp';
end
At(1,1) = svec(blk(1,:),Acell,1);

At{2,1} = -spdiags([1; gam],0,n+1,n+1);
%%*************************************************************************
%% ToeplitzApproxSQQ: find the nearest symmetric positive definite Toeplitz
%% matrix to a given symmetric matrix F.
%%
%% max -y0
%% s.t. y0*B + T(y) (S>=) 0
%% [y0; gam.*y] + [0; q./gam] (Q>=) 0
%%
%% where B = diag([zeros(n,1); 1])
%% q(1) = - Tr(F); q(k+1) = -sum of upper and lower kth diagonals of F
%% gam(1) = sqrt(n); gam(k) = sqrt(2*(n-k+1)) for k=2:n
%%*****************************************************************
%% SDPT3: version 4.0
%% Copyright (c) 1997 by
%% Kim-Chuan Toh, Michael J. Todd, Reha H. Tutuncu
%% Last Modified: 16 Sep 2004
%%*****************************************************************

function [blk,At,C,b] = ToeplitzApproxSQQ(F)

n = length(F);
gam = sqrt([n, 2*(n-1:-1:1)]');
q = zeros(n,1);
q(1) = -sum(diag(F));
for k=1:n-1
q(k+1) = -2*sum(diag(F,k));
end
beta = norm(F,'fro')^2;

blk{1,1} = 's'; blk{1,2} = n+1;
blk{2,1} = 'q'; blk{2,2} = n+1;

b = [-1; zeros(n,1)];
C{1,1} = sparse(n+1,n+1);
C{2,1} = [0; q./gam];

Acell = cell(1,n+1);
Acell{1} = -spconvert([n+1,n+1,1]);
Acell{2} = -spdiags([ones(n,1); 0],0,n+1,n+1);
for k = 1:n-1
tmp = -spdiags([ones(n,1); 0],k,n+1,n+1);
Acell{k+2} = tmp + tmp';
end
At(1,1) = svec(blk(1,:),Acell,1);

At{2,1} = -spdiags([1; gam],0,n+1,n+1);
%%***********************************************************************
10 changes: 5 additions & 5 deletions Examples/cheby0.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
%% = 0 if otherwise.
%% solve = 0 if just want initialization
%% = 1 if want to solve the problem
%%
%% SDPT3: version 3.0
%%*****************************************************************
%% SDPT3: version 4.0
%% Copyright (c) 1997 by
%% K.C. Toh, M.J. Todd, R.H. Tutuncu
%% Last modified: 2 Feb 01
%%**********************************************************
%% Kim-Chuan Toh, Michael J. Todd, Reha H. Tutuncu
%% Last Modified: 16 Sep 2004
%%*****************************************************************

function [blk,Avec,C,b,X0,y0,Z0,objval,p] = cheby0(d,m,solve);

Expand Down
10 changes: 5 additions & 5 deletions Examples/chebyinf.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
%% = 0 if otherwise.
%% solve = 0 if just want initialization
%% = 1 if want to solve using sdp.m
%%
%% SDPT3: version 3.0
%%*****************************************************************
%% SDPT3: version 4.0
%% Copyright (c) 1997 by
%% K.C. Toh, M.J. Todd, R.H. Tutuncu
%% Last modified: 2 Feb 01
%%**********************************************************
%% Kim-Chuan Toh, Michael J. Todd, Reha H. Tutuncu
%% Last Modified: 16 Sep 2004
%%*****************************************************************

function [blk,Avec,C,b,X0,y0,Z0,objval,p] = chebyinf(d,m,solve);

Expand Down
10 changes: 5 additions & 5 deletions Examples/chebymat.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
%% = 2 if want to solve using sdphlf.m
%%
%% p = Chebyshev polynomial of B in Matlab format.
%%
%% SDPT3: version 3.0
%%*****************************************************************
%% SDPT3: version 4.0
%% Copyright (c) 1997 by
%% K.C. Toh, M.J. Todd, R.H. Tutuncu
%% Last modified: 2 Feb 01
%%*********************************************************************
%% Kim-Chuan Toh, Michael J. Todd, Reha H. Tutuncu
%% Last Modified: 16 Sep 2004
%%*****************************************************************

function [blk,Avec,C,b,X0,y0,Z0,objval,p] = chebymat(B,m,feas,solve);

Expand Down
12 changes: 5 additions & 7 deletions Examples/control.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
%% s.t Bk'*P + P*Bk <= 0, k = 1:L
%% P <= I,
%% P >= t*I, P = P'.
%%
%%------------------------------------------------------
%%
%% [blk,Avec,C,b,X0,y0,Z0,objval,P] = control(B,solve),
%%
%% where B{k} = Bk, k = 1:L.
Expand All @@ -22,12 +20,12 @@
%%
%% solve = 0 just to initialize
%% = 1 if want to solve the problem
%%
%% SDPT3: version 3.0
%%*****************************************************************
%% SDPT3: version 4.0
%% Copyright (c) 1997 by
%% K.C. Toh, M.J. Todd, R.H. Tutuncu
%% Last modified: 2 Feb 01
%%******************************************************
%% Kim-Chuan Toh, Michael J. Todd, Reha H. Tutuncu
%% Last Modified: 16 Sep 2004
%%*****************************************************************

function [blk,Avec,C,b,X0,y0,Z0,objval,P] = control(B,solve);

Expand Down
10 changes: 5 additions & 5 deletions Examples/corrmat.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
%% s.t. diag(X) = e
%% svec(X) + y = svec(H),
%% X psd, ||y||_2 <= t.
%%
%% SDPT3: version 3.0
%%*****************************************************************
%% SDPT3: version 4.0
%% Copyright (c) 1997 by
%% K.C. Toh, M.J. Todd, R.H. Tutuncu
%% Last modified: 18 Dec 01
%%****************************************************
%% Kim-Chuan Toh, Michael J. Todd, Reha H. Tutuncu
%% Last Modified: 16 Sep 2004
%%*****************************************************************

function [blk,At,C,b] = corrmat(H);

Expand Down
9 changes: 5 additions & 4 deletions Examples/dwd.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@
%% are on the wrong side of the hyperplane: they can be moved a
%% distance d at a cost penalty*d to put them on the right side.
%%
%% SDPT3: version 3.0
%%*****************************************************************
%% SDPT3: version 4.0
%% Copyright (c) 1997 by
%% K.C. Toh, M.J. Todd, R.H. Tutuncu
%% Last modified: 20 Apr 02
%%******************************************************************
%% Kim-Chuan Toh, Michael J. Todd, Reha H. Tutuncu
%% Last Modified: 16 Sep 2004
%%*****************************************************************

function [w,beta,residp,residn,totalviolation,X,y,Z] = ...
dwd(Ap,An,penalty);
Expand Down
Loading

0 comments on commit bc93ea8

Please sign in to comment.