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
0050 v{1} = struct( 'Name', 'MATPOWER', ...
0051 'Version', '4.1', ...
0052 'Release', '', ...
0053 'Date', '14-Dec-2011' );
0054 if nargout > 0
0055 if nargin > 0
0056 rv = v{1};
0057 else
0058 rv = v{1}.Version;
0059 end
0060 else
0061 if have_fcn('octave')
0062 v{2} = ver('octave');
0063 else
0064 v{2} = ver('matlab');
0065 end
0066 v{3} = ver('optim');
0067 for n = 1:3
0068 if n == 3 && isempty(v{3})
0069 fprintf('\n%-22s -- not installed --', 'Optimization Toolbox');
0070 continue;
0071 end
0072 fprintf('\n%-22s Version %-9s', v{n}.Name, v{n}.Version);
0073 if ~isempty(v{n}.Date)
0074 fprintf(' %11s', v{n}.Date);
0075 if ~isempty(v{n}.Release)
0076 fprintf(' Release: %-10s', v{n}.Release);
0077 end
0078 end
0079 end
0080 fprintf('\n');
0081 mipsver;
0082 if have_fcn('bpmpd')
0083 if exist('bpver', 'file') == 2
0084 bpver;
0085 else
0086 fprintf('%-22s Version 2.21 or earlier\n', 'BPMPD_MEX');
0087 end
0088 else
0089 fprintf('%-22s -- not installed --\n', 'BPMPD_MEX');
0090 end
0091 if have_fcn('cplex')
0092 cplex = Cplex('null');
0093 fprintf('%-22s Version %-10s %-11s %s\n', 'CPLEX', cplex.getVersion, '', computer);
0094 else
0095 fprintf('%-22s -- not installed --\n', 'CPLEX');
0096 end
0097 if have_fcn('ipopt')
0098 str = evalc('qps_ipopt([],1,1,1,1,1,1,1,struct(''verbose'', 2))');
0099 pat = 'Ipopt version ([^\s,]+)';
0100 [s,e,tE,m,t] = regexp(str, pat);
0101 if isempty(t)
0102 vn = '<unknown>';
0103 else
0104 vn = t{1}{1};
0105 end
0106 fprintf('%-22s Version %-10s %-11s %s\n', 'IPOPT', vn, '', computer);
0107 else
0108 fprintf('%-22s -- not installed --\n', 'IPOPT');
0109 end
0110 if have_fcn('gurobi')
0111 [x, f, e, o] = gurobi_mex(1, 1, [], [], [], 1, 1, 'C', ...
0112 struct('Display', 0, 'DisplayInterval', Inf));
0113 if isfield(o, 'Versions')
0114 vn = sprintf('%d.%d.%d/%.2f', o.Versions.LibMajor, ...
0115 o.Versions.LibMinor, o.Versions.LibTechi, o.Versions.GurobiMex);
0116 elseif isfield(o, 'Lib.Ver.Major')
0117 vn = sprintf('%d.%d.%d/%.2f', o.('Lib.Ver.Major'), ...
0118 o.('Lib.Ver.Minor'), o.('Lib.Ver.Techi'), o.('GurobiMex.Ver'));
0119 else
0120 vn = '<unknown>';
0121 end
0122 fprintf('%-22s Version %-10s %-11s %s\n', 'Gurobi', vn, '', computer);
0123 else
0124 fprintf('%-22s -- not installed --\n', 'Gurobi');
0125 end
0126 if have_fcn('knitro')
0127 str = evalc('[x fval] = ktrlink(@(x)1,1);');
0128 pat = 'KNITRO ([^\s]+)\n';
0129 [s,e,tE,m,t] = regexp(str, pat);
0130 if isempty(t)
0131 vn = '<unknown>';
0132 else
0133 vn = t{1}{1};
0134 end
0135 fprintf('%-22s Version %-10s %-11s %s\n', 'KNITRO', vn, '', computer);
0136 else
0137 fprintf('%-22s -- not installed --\n', 'KNITRO');
0138 end
0139 if have_fcn('minopf')
0140 if exist('minopfver', 'file') == 2
0141 minopfver;
0142 else
0143 fprintf('%-22s Version 3.0b2 or earlier\n', 'MINOPF');
0144 end
0145 else
0146 fprintf('%-22s -- not installed --\n', 'MINOPF');
0147 end
0148 if have_fcn('mosek')
0149
0150
0151
0152
0153 pat = 'Version (\.*\d)+.*Build date: (\d+-\d+-\d+)';
0154 [s,e,tE,m,t] = regexp(evalc('mosekopt'), pat);
0155 if isempty(t)
0156 vn = '<unknown>';
0157 d = '';
0158 else
0159 vn = t{1}{1};
0160 d = datestr(t{1}{2}, 'dd-mmm-yyyy');
0161 end
0162 fprintf('%-22s Version %-10s %-11s %s\n', 'MOSEK', vn, d, computer);
0163 else
0164 fprintf('%-22s -- not installed --\n', 'MOSEK');
0165 end
0166 if have_fcn('pdipmopf')
0167 pdipmopfver;
0168 else
0169 fprintf('%-22s -- not installed --\n', 'PDIPMOPF');
0170 end
0171 if have_fcn('scpdipmopf')
0172 scpdipmopfver;
0173 else
0174 fprintf('%-22s -- not installed --\n', 'SCPDIPMOPF');
0175 end
0176 if have_fcn('tralmopf')
0177 tralmopfver;
0178 else
0179 fprintf('%-22s -- not installed --\n', 'TRALMOPF');
0180 end
0181
0182 fprintf('%-22s %s\n\n', 'Architecture:', computer);
0183
0184 fprintf(' MATPOWER %s is distributed under the GNU General Public License.\n', v{1}.Version);
0185 fprintf(' Please see the LICENSE and COPYING files for details.\n\n');
0186 end