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.0', ...
0052 'Release', '', ...
0053 'Date', '07-Feb-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('minopf')
0111 if exist('minopfver', 'file') == 2
0112 minopfver;
0113 else
0114 fprintf('%-22s Version 3.0b2 or earlier\n', 'MINOPF');
0115 end
0116 else
0117 fprintf('%-22s -- not installed --\n', 'MINOPF');
0118 end
0119 if have_fcn('mosek')
0120 pat = 'Version (\.*\d)+.*Build date: (\d\d\d\d-\d\d-\d\d)';
0121 [s,e,tE,m,t] = regexp(evalc('mosekopt'), pat);
0122 if isempty(t)
0123 vn = '<unknown>';
0124 d = '';
0125 else
0126 vn = t{1}{1};
0127 d = datestr(t{1}{2}, 'dd-mmm-yyyy');
0128 end
0129 fprintf('%-22s Version %-10s %-11s %s\n', 'MOSEK', vn, d, computer);
0130 else
0131 fprintf('%-22s -- not installed --\n', 'MOSEK');
0132 end
0133 if have_fcn('pdipmopf')
0134 pdipmopfver;
0135 else
0136 fprintf('%-22s -- not installed --\n', 'PDIPMOPF');
0137 end
0138 if have_fcn('scpdipmopf')
0139 scpdipmopfver;
0140 else
0141 fprintf('%-22s -- not installed --\n', 'SCPDIPMOPF');
0142 end
0143 if have_fcn('tralmopf')
0144 tralmopfver;
0145 else
0146 fprintf('%-22s -- not installed --\n', 'TRALMOPF');
0147 end
0148
0149 fprintf('%-22s %s\n\n', 'Architecture:', computer);
0150
0151 fprintf(' MATPOWER %s is distributed under the GNU General Public License.\n', v{1}.Version);
0152 fprintf(' Please see the LICENSE and COPYING files for details.\n\n');
0153 end