0001 function rv = mpver(varargin)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049 v{1} = struct( 'Name', 'MATPOWER', ...
0050 'Version', '5.0', ...
0051 'Release', '', ...
0052 'Date', '17-Dec-2014' );
0053 if nargout > 0
0054 if nargin > 0
0055 rv = v{1};
0056 else
0057 rv = v{1}.Version;
0058 end
0059 else
0060 if have_fcn('octave')
0061 v{2} = ver('octave');
0062 else
0063 v{2} = ver('matlab');
0064 end
0065 v{3} = ver('optim');
0066 for n = 1:3
0067 if n == 3 && isempty(v{3})
0068 fprintf('\n%-22s -- not installed --', 'Optimization Toolbox');
0069 continue;
0070 elseif n == 3 && ~license('test', 'optimization_toolbox')
0071 fprintf('\n%-22s -- no license --', 'Optimization Toolbox');
0072 continue;
0073 end
0074 fprintf('\n%-22s Version %-9s', v{n}.Name, v{n}.Version);
0075 if ~isempty(v{n}.Date)
0076 fprintf(' %11s', v{n}.Date);
0077 if ~isempty(v{n}.Release)
0078 fprintf(' Release: %-10s', v{n}.Release);
0079 end
0080 end
0081 end
0082 fprintf('\n');
0083 mipsver;
0084 if have_fcn('sdp_pf')
0085 sdp_pf_ver;
0086 else
0087 fprintf('%-22s -- not installed --\n', 'SDP_PF');
0088 end
0089 if have_fcn('yalmip')
0090 str = evalc('yalmip;');
0091 pat = 'Version\s+([^\s]+)\n';
0092 [s,e,tE,m,t] = regexp(str, pat);
0093 if isempty(t)
0094 vn = '<unknown>';
0095 else
0096 vn = t{1}{1};
0097 end
0098 fprintf('%-22s Version %-10s %-11s\n', 'YALMIP', '', vn);
0099 else
0100 fprintf('%-22s -- not installed --\n', 'YALMIP');
0101 end
0102 if have_fcn('bpmpd')
0103 if exist('bpver', 'file') == 2
0104 bpver;
0105 else
0106 fprintf('%-22s Version 2.21 or earlier\n', 'BPMPD_MEX');
0107 end
0108 else
0109 fprintf('%-22s -- not installed --\n', 'BPMPD_MEX');
0110 end
0111 if have_fcn('cplex')
0112 cplex = Cplex('null');
0113 fprintf('%-22s Version %-10s %-11s %s\n', 'CPLEX', cplex.getVersion, '', computer);
0114 else
0115 fprintf('%-22s -- not installed --\n', 'CPLEX');
0116 end
0117 if have_fcn('gurobi')
0118 gurobiver;
0119 else
0120 fprintf('%-22s -- not installed --\n', 'Gurobi');
0121 end
0122 if have_fcn('glpk')
0123
0124
0125
0126
0127
0128
0129
0130
0131
0132 vn = '<unknown>';
0133 fprintf('%-22s Version %-10s %-11s %s\n', 'GLPK', vn, '', computer);
0134 else
0135 fprintf('%-22s -- not installed --\n', 'GLPK');
0136 end
0137 if have_fcn('ipopt')
0138 str = evalc('qps_ipopt([],1,1,1,1,1,1,1,struct(''verbose'', 2))');
0139 pat = 'Ipopt version ([^\s,]+)';
0140 [s,e,tE,m,t] = regexp(str, pat);
0141 if isempty(t)
0142 vn = '<unknown>';
0143 else
0144 vn = t{1}{1};
0145 end
0146 fprintf('%-22s Version %-10s %-11s %s\n', 'IPOPT', vn, '', computer);
0147 else
0148 fprintf('%-22s -- not installed --\n', 'IPOPT');
0149 end
0150 if have_fcn('knitro')
0151 if have_fcn('knitromatlab')
0152 str = evalc('[x fval] = knitromatlab(@(x)1,1);');
0153 elseif have_fcn('ktrlink')
0154 str = evalc('[x fval] = ktrlink(@(x)1,1);');
0155 end
0156 pat = 'KNITRO ([^\s]+)\n';
0157 [s,e,tE,m,t] = regexp(str, pat);
0158 if isempty(t)
0159 vn = '<unknown>';
0160 else
0161 vn = t{1}{1};
0162 end
0163 fprintf('%-22s Version %-10s %-11s %s\n', 'KNITRO', vn, '', computer);
0164 else
0165 fprintf('%-22s -- not installed --\n', 'KNITRO');
0166 end
0167 if have_fcn('minopf')
0168 if exist('minopfver', 'file') == 2
0169 minopfver;
0170 else
0171 fprintf('%-22s Version 3.0b2 or earlier\n', 'MINOPF');
0172 end
0173 else
0174 fprintf('%-22s -- not installed --\n', 'MINOPF');
0175 end
0176 if have_fcn('mosek')
0177
0178
0179
0180
0181 pat = 'Version (\.*\d)+.*Build date: (\d+-\d+-\d+)';
0182 [s,e,tE,m,t] = regexp(evalc('mosekopt'), pat);
0183 if isempty(t)
0184 vn = '<unknown>';
0185 d = '';
0186 else
0187 vn = t{1}{1};
0188 d = datestr(t{1}{2}, 'dd-mmm-yyyy');
0189 end
0190 fprintf('%-22s Version %-10s %-11s %s\n', 'MOSEK', vn, d, computer);
0191 else
0192 fprintf('%-22s -- not installed --\n', 'MOSEK');
0193 end
0194 if have_fcn('pdipmopf')
0195 pdipmopfver;
0196 else
0197 fprintf('%-22s -- not installed --\n', 'PDIPMOPF');
0198 end
0199 if have_fcn('scpdipmopf')
0200 scpdipmopfver;
0201 else
0202 fprintf('%-22s -- not installed --\n', 'SCPDIPMOPF');
0203 end
0204 if have_fcn('sdpt3')
0205 str = evalc('help sdpt3');
0206 pat = 'version\s+([^\s]+).*Last Modified: ([^\n]+)\n';
0207 [s,e,tE,m,t] = regexp(str, pat);
0208 if isempty(t)
0209 vn = '<unknown>';
0210 d = '';
0211 else
0212 vn = t{1}{1};
0213 d = datestr(t{1}{2}, 'dd-mmm-yyyy');
0214 end
0215 fprintf('%-22s Version %-10s %-11s %s\n', 'SDPT3', vn, d, computer);
0216 else
0217 fprintf('%-22s -- not installed --\n', 'SDPT3');
0218 end
0219 if have_fcn('sedumi')
0220 str = evalc('x = sedumi([1 1], 1, [1;2])');
0221 pat = 'SeDuMi\s+([^\s]+)';
0222 [s,e,tE,m,t] = regexp(str, pat);
0223 if isempty(t)
0224 vn = '<unknown>';
0225 else
0226 vn = t{1}{1};
0227 end
0228 fprintf('%-22s Version %-10s %-11s %s\n', 'SeDuMi', vn, '', computer);
0229 else
0230 fprintf('%-22s -- not installed --\n', 'SeDuMi');
0231 end
0232 if have_fcn('tralmopf')
0233 tralmopfver;
0234 else
0235 fprintf('%-22s -- not installed --\n', 'TRALMOPF');
0236 end
0237
0238 fprintf('%-22s %s\n\n', 'Architecture:', computer);
0239
0240 fprintf(' MATPOWER %s is distributed under the GNU General Public License.\n', v{1}.Version);
0241 fprintf(' Please see the LICENSE and COPYING files for details.\n\n');
0242 end