-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Overhaul code for VSDP 2020 release.
- Loading branch information
Showing
50 changed files
with
64 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,15 @@ | ||
classdef csdp < handle | ||
% CSDP Solver proxy class (not the acutal solver!). | ||
% CSDP Solver proxy class (not the actual solver!). | ||
% | ||
% For more information about CSDP, see: | ||
% | ||
% https://projects.coin-or.org/Csdp/ | ||
% https://github.com/coin-or/Csdp | ||
% | ||
% See also vsdp.solve. | ||
% | ||
|
||
% Copyright 2004-2019 Christian Jansson ([email protected]) | ||
|
||
% Copyright 2004-2020 Christian Jansson ([email protected]) | ||
methods (Static) | ||
function obj = solve (obj, sol_type) | ||
% SOLVE Approximately solve conic problem instance with CSDP. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
classdef glpk < handle | ||
% GLPK Solver proxy class (not the acutal solver!). | ||
% GLPK Solver proxy class (not the actual solver!). | ||
% | ||
% For more information about GLPK, see: | ||
% | ||
|
@@ -8,8 +8,8 @@ | |
% See also vsdp.solve. | ||
% | ||
|
||
% Copyright 2004-2019 Christian Jansson ([email protected]) | ||
|
||
% Copyright 2004-2020 Christian Jansson ([email protected]) | ||
methods (Static) | ||
function obj = solve (obj, sol_type) | ||
% SOLVE Approximately solve conic problem instance with GLPK. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
classdef intlab < handle | ||
% INTLAB Solver proxy class (not the acutal solver!). | ||
% INTLAB Solver proxy class (not the actual solver!). | ||
% | ||
% For information about INTLAB, see: | ||
% | ||
|
@@ -8,8 +8,8 @@ | |
% See also vsdp.solve. | ||
% | ||
|
||
% Copyright 2004-2019 Christian Jansson ([email protected]) | ||
|
||
% Copyright 2004-2020 Christian Jansson ([email protected]) | ||
methods (Static) | ||
function spath = install (varargin) | ||
% Returns the path to the installed and usable solver. Otherwise return | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
classdef linprog < handle | ||
% LINPROG Solver proxy class (not the acutal solver!). | ||
% LINPROG Solver proxy class (not the actual solver!). | ||
% | ||
% For more information about LINPROG, see: | ||
% | ||
|
@@ -8,8 +8,8 @@ | |
% See also vsdp.solve. | ||
% | ||
|
||
% Copyright 2004-2019 Christian Jansson ([email protected]) | ||
|
||
% Copyright 2004-2020 Christian Jansson ([email protected]) | ||
methods (Static) | ||
function obj = solve (obj, sol_type) | ||
% SOLVE Approximately solve conic problem instance with LINPROG. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
classdef lp_solve < handle | ||
% LP_SOLVE Solver proxy class (not the acutal solver!). | ||
% LP_SOLVE Solver proxy class (not the actual solver!). | ||
% | ||
% For more information about LP_SOLVE, see: | ||
% | ||
|
@@ -8,8 +8,8 @@ | |
% See also vsdp.solve. | ||
% | ||
|
||
% Copyright 2004-2019 Christian Jansson ([email protected]) | ||
|
||
% Copyright 2004-2020 Christian Jansson ([email protected]) | ||
methods (Static) | ||
function obj = solve (obj, sol_type) | ||
% SOLVE Approximately solve conic problem instance with LP_SOLVE. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
classdef mosek < handle | ||
% MOSEK Solver proxy class (not the acutal solver!). | ||
% MOSEK Solver proxy class (not the actual solver!). | ||
% | ||
% For more information on the MOSEK format, see: | ||
% | ||
|
@@ -8,8 +8,8 @@ | |
% See also vsdp.solve. | ||
% | ||
|
||
% Copyright 2004-2019 Christian Jansson ([email protected]) | ||
|
||
% Copyright 2004-2020 Christian Jansson ([email protected]) | ||
methods (Static) | ||
function obj = solve (obj, sol_type) | ||
% SOLVE Approximately solve conic problem instance with MOSEK. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,8 +4,8 @@ | |
% See also vsdp.solve. | ||
% | ||
|
||
% Copyright 2004-2019 Christian Jansson ([email protected]) | ||
|
||
% Copyright 2004-2020 Christian Jansson ([email protected]) | ||
methods (Static) | ||
function slist = list_all () | ||
% LIST_ALL Return a list with all solvers supported by VSDP. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
classdef sdpa < handle | ||
% SDPA Solver proxy class (not the acutal solver!). | ||
% SDPA Solver proxy class (not the actual solver!). | ||
% | ||
% For more information on the SDPA-M format, see: | ||
% | ||
|
@@ -9,8 +9,8 @@ | |
% See also vsdp.solve. | ||
% | ||
|
||
% Copyright 2004-2019 Christian Jansson ([email protected]) | ||
|
||
% Copyright 2004-2020 Christian Jansson ([email protected]) | ||
methods (Static) | ||
function obj = solve (obj, sol_type) | ||
% SOLVE Approximately solve conic problem instance with SDPA. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
classdef sdpt3 < handle | ||
% SDPT3 Solver proxy class (not the acutal solver!). | ||
% SDPT3 Solver proxy class (not the actual solver!). | ||
% | ||
% For information about SDPT3, see: | ||
% | ||
|
@@ -9,8 +9,8 @@ | |
% See also vsdp.solve. | ||
% | ||
|
||
% Copyright 2004-2019 Christian Jansson ([email protected]) | ||
|
||
% Copyright 2004-2020 Christian Jansson ([email protected]) | ||
methods (Static) | ||
function obj = solve (obj, sol_type) | ||
% SOLVE Approximately solve conic problem instance with SDPT3. | ||
|
@@ -110,7 +110,7 @@ | |
spath = solver.registry.generic_install (sname, is_available, ... | ||
get_path, installer_file, do_error); | ||
|
||
% Return on sucess or non-interactive silent mode. | ||
% Return on success or non-interactive silent mode. | ||
if ((nargin == 0) || (~isempty (spath))) | ||
return; | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
classdef sedumi < handle | ||
% SEDUMI Solver proxy class (not the acutal solver!). | ||
% SEDUMI Solver proxy class (not the actual solver!). | ||
% | ||
% For information about SeDuMi, see: | ||
% | ||
|
@@ -9,8 +9,8 @@ | |
% See also vsdp.solve. | ||
% | ||
|
||
% Copyright 2004-2019 Christian Jansson ([email protected]) | ||
|
||
% Copyright 2004-2020 Christian Jansson ([email protected]) | ||
methods (Static) | ||
function obj = solve (obj, sol_type) | ||
% SOLVE Approximately solve conic problem instance with SeDuMi. | ||
|
@@ -101,7 +101,7 @@ | |
spath = solver.registry.generic_install (sname, is_available, ... | ||
get_path, installer_file, do_error); | ||
|
||
% Return on sucess or non-interactive silent mode. | ||
% Return on success or non-interactive silent mode. | ||
if ((nargin == 0) || (~isempty (spath))) | ||
return; | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
% | ||
% See also vsdp, vsdp_solution. | ||
|
||
% Copyright 2004-2019 Christian Jansson ([email protected]) | ||
% Copyright 2004-2020 Christian Jansson ([email protected]) | ||
|
||
if (nargin == 2) | ||
if (~isa (varargin{1}, 'vsdp_solution')) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ | |
% See also vsdp. | ||
% | ||
|
||
% Copyright 2004-2019 Christian Jansson ([email protected]) | ||
% Copyright 2004-2020 Christian Jansson ([email protected]) | ||
|
||
narginchk (1, 3); | ||
if (nargout ~= 1) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ | |
% See also vsdp. | ||
% | ||
|
||
% Copyright 2004-2019 Christian Jansson ([email protected]) | ||
% Copyright 2004-2020 Christian Jansson ([email protected]) | ||
|
||
narginchk (2, 2); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ | |
% See also vsdp. | ||
% | ||
|
||
% Copyright 2004-2019 Christian Jansson ([email protected]) | ||
% Copyright 2004-2020 Christian Jansson ([email protected]) | ||
|
||
if (iscell (X)) | ||
x = cell2mat (cellfun (@(x) x(:), X, 'UniformOutput', false)); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,7 @@ | |
% See also vsdp, vsdp.cell2mat. | ||
% | ||
|
||
% Copyright 2004-2019 Christian Jansson ([email protected]) | ||
% Copyright 2004-2020 Christian Jansson ([email protected]) | ||
|
||
if (nargin == 2 && iscell (X) && iscell (blk)) | ||
idx = find (strcmp (blk(:,1), 's') & (cellfun (@length, blk(:,2)) > 1)); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,7 @@ | |
% vsdp.check_primal_infeasible. | ||
% | ||
|
||
% Copyright 2004-2019 Christian Jansson ([email protected]) | ||
% Copyright 2004-2020 Christian Jansson ([email protected]) | ||
|
||
narginchk (1, 2); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,7 +42,7 @@ | |
% vsdp.check_dual_infeasible. | ||
% | ||
|
||
% Copyright 2004-2019 Christian Jansson ([email protected]) | ||
% Copyright 2004-2020 Christian Jansson ([email protected]) | ||
|
||
narginchk (1, 2); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ function disp (obj) | |
% | ||
% See also vsdp.info. | ||
|
||
% Copyright 2004-2019 Christian Jansson ([email protected]) | ||
% Copyright 2004-2020 Christian Jansson ([email protected]) | ||
|
||
% Determine object name. | ||
obj_name = inputname(1); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,7 +39,7 @@ | |
% | ||
% See also vsdp. | ||
|
||
% Copyright 2004-2019 Christian Jansson ([email protected]) | ||
% Copyright 2004-2020 Christian Jansson ([email protected]) | ||
|
||
narginchk (4, 7); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,7 @@ | |
% See also from_mps_file. | ||
% | ||
|
||
% Copyright 2004-2019 Christian Jansson ([email protected]) | ||
% Copyright 2004-2020 Christian Jansson ([email protected]) | ||
|
||
narginchk(4, 6); | ||
b = b(:); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ | |
% See also from_lp_solve_fmt. | ||
% | ||
|
||
% Copyright 2004-2019 Christian Jansson ([email protected]) | ||
% Copyright 2004-2020 Christian Jansson ([email protected]) | ||
|
||
narginchk(1, 1); | ||
if (exist (fname, 'file') ~= 2) | ||
|
@@ -110,7 +110,7 @@ | |
% columns i, j and k are in an SOS2 set | ||
% | ||
|
||
% Copyright 2004-2012 Christian Jansson ([email protected]) | ||
% Copyright 2004-2020 Christian Jansson ([email protected]) | ||
|
||
% initialize default output | ||
problem.name = ''; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ | |
% See also vsdp. | ||
% | ||
|
||
% Copyright 2004-2019 Christian Jansson ([email protected]) | ||
% Copyright 2004-2020 Christian Jansson ([email protected]) | ||
|
||
narginchk(1, 2); | ||
if (exist (fname, 'file') ~= 2) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,7 +43,7 @@ | |
% | ||
% See also from_sdpa_file. | ||
|
||
% Copyright 2004-2019 Christian Jansson ([email protected]) | ||
% Copyright 2004-2020 Christian Jansson ([email protected]) | ||
|
||
narginchk(3, 6); | ||
if (isempty (bLOCKsTRUCT)) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,13 +54,12 @@ | |
% | ||
% For more information on the SDPT3-4.0 format, see: | ||
% | ||
% [1] http://www.math.nus.edu.sg/~mattohkc/sdpt3/guide4-0-draft.pdf | ||
% [2] http://www.math.nus.edu.sg/~mattohkc/sdpt3/sdpexample.html | ||
% https://blog.nus.edu.sg/mattohkc/files/2019/10/guide4-0-draft.pdf | ||
% | ||
% See also vsdp. | ||
% | ||
|
||
% Copyright 2004-2019 Christian Jansson ([email protected]) | ||
% Copyright 2004-2020 Christian Jansson ([email protected]) | ||
|
||
narginchk(4, 7); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
% See also vsdp. | ||
% | ||
|
||
% Copyright 2004-2019 Christian Jansson ([email protected]) | ||
% Copyright 2004-2020 Christian Jansson ([email protected]) | ||
|
||
[At, b, c] = deal (mid (obj.At), mid (obj.b), mid (obj.c)); | ||
if ((nargin > 1) && ~strcmp (sol_type, "Approximate")) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ function info (obj) | |
% See also vsdp. | ||
% | ||
|
||
% Copyright 2004-2019 Christian Jansson ([email protected]) | ||
% Copyright 2004-2020 Christian Jansson ([email protected]) | ||
|
||
% Short conic programming theory. | ||
fprintf ('\n VSDP conic programming problem in primal (P) dual (D) form:\n\n'); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,7 +32,7 @@ | |
% See also vsdp, vsdp.rigorous_upper_bound. | ||
% | ||
|
||
% Copyright 2004-2019 Christian Jansson ([email protected]) | ||
% Copyright 2004-2020 Christian Jansson ([email protected]) | ||
|
||
narginchk (1, 2); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,7 +34,7 @@ | |
% See also vsdp, vsdp.rigorous_lower_bound, vsdp.rigorous_upper_bound. | ||
% | ||
|
||
% Copyright 2004-2019 Christian Jansson ([email protected]) | ||
% Copyright 2004-2020 Christian Jansson ([email protected]) | ||
|
||
n = obj.K.f + obj.K.l + length (obj.K.q) + length (obj.K.s); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ | |
% See also vsdp, vsdp.rigorous_lower_bound. | ||
% | ||
|
||
% Copyright 2004-2019 Christian Jansson ([email protected]) | ||
% Copyright 2004-2020 Christian Jansson ([email protected]) | ||
|
||
% Validate dual upper bounds. | ||
if (nargin == 2) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ | |
% val = vsdp.settings ('id', 'key'); | ||
% | ||
|
||
% Copyright 2004-2019 Christian Jansson ([email protected]) | ||
% Copyright 2004-2020 Christian Jansson ([email protected]) | ||
|
||
persistent vsdp_settings; % In memory copy of VSDP settings file. | ||
persistent settings_file; | ||
|
@@ -51,5 +51,5 @@ | |
% SYS_HASH Compute a system unique hash value. | ||
% | ||
|
||
val = sum (double ([computer(), '_vsdp_2018_', version()])); | ||
val = sum (double ([computer(), '_vsdp_2020_', version()])); | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,7 +84,7 @@ | |
% See also vsdp, vsdp.svec, vsdp.smat. | ||
% | ||
|
||
% Copyright 2004-2019 Christian Jansson ([email protected]) | ||
% Copyright 2004-2020 Christian Jansson ([email protected]) | ||
|
||
if (isa (obj, 'vsdp')) | ||
K = obj.K; | ||
|
Oops, something went wrong.