Home > matpower5.0 > mpver.m

mpver

PURPOSE ^

MPVER Prints or returns MATPOWER version info for current installation.

SYNOPSIS ^

function rv = mpver(varargin)

DESCRIPTION ^

MPVER  Prints or returns MATPOWER version info for current installation.
   V = MPVER returns the current MATPOWER version number.
   V = MPVER('all') returns a struct with the fields Name, Version,
   Release and Date (all strings). Calling MPVER without assigning the
   return value prints the version and release date of the current
   installation of MATPOWER, MATLAB (or Octave), the Optimization Toolbox,
   MIPS and any optional MATPOWER packages.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function rv = mpver(varargin)
0002 %MPVER  Prints or returns MATPOWER version info for current installation.
0003 %   V = MPVER returns the current MATPOWER version number.
0004 %   V = MPVER('all') returns a struct with the fields Name, Version,
0005 %   Release and Date (all strings). Calling MPVER without assigning the
0006 %   return value prints the version and release date of the current
0007 %   installation of MATPOWER, MATLAB (or Octave), the Optimization Toolbox,
0008 %   MIPS and any optional MATPOWER packages.
0009 
0010 %   MATPOWER
0011 %   $Id: mpver.m 2489 2014-12-17 16:27:36Z ray $
0012 %   by Ray Zimmerman, PSERC Cornell
0013 %   Copyright (c) 2005-2014 by Power System Engineering Research Center (PSERC)
0014 %
0015 %   This file is part of MATPOWER.
0016 %   See http://www.pserc.cornell.edu/matpower/ for more info.
0017 %
0018 %   MATPOWER is free software: you can redistribute it and/or modify
0019 %   it under the terms of the GNU General Public License as published
0020 %   by the Free Software Foundation, either version 3 of the License,
0021 %   or (at your option) any later version.
0022 %
0023 %   MATPOWER is distributed in the hope that it will be useful,
0024 %   but WITHOUT ANY WARRANTY; without even the implied warranty of
0025 %   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0026 %   GNU General Public License for more details.
0027 %
0028 %   You should have received a copy of the GNU General Public License
0029 %   along with MATPOWER. If not, see <http://www.gnu.org/licenses/>.
0030 %
0031 %   Additional permission under GNU GPL version 3 section 7
0032 %
0033 %   If you modify MATPOWER, or any covered work, to interface with
0034 %   other modules (such as MATLAB code and MEX-files) available in a
0035 %   MATLAB(R) or comparable environment containing parts covered
0036 %   under other licensing terms, the licensors of MATPOWER grant
0037 %   you additional permission to convey the resulting work.
0038 
0039 %% the following only works if MATPOWER is explicitly in the path,
0040 %% but not if it is only in the current working directory
0041 % fs = filesep;
0042 % p = fileparts(which('runpf'));
0043 % if ~strcmp(p(1),fs)
0044 %   [t, p] = strtok(p, filesep);
0045 % end
0046 % p = p(2:end);
0047 % v{1} = ver(p);
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 %% bummer, evalc not yet implemented in Octave (as of 3.8)
0124 %         str = evalc('glpk(1, 1, 1, 1, 1, ''U'', ''C'', -1, struct(''msglev'', 3))');
0125 %         pat = 'GLPK Simplex Optimizer, v([^\s,]+)';
0126 %         [s,e,tE,m,t] = regexp(str, pat);
0127 %         if isempty(t)
0128 %             vn = '<unknown>';
0129 %         else
0130 %             vn = t{1}{1};
0131 %         end
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         % (this code is also in qps_mosek.m)
0178         % MOSEK Version 6.0.0.93 (Build date: 2010-10-26 13:03:27)
0179         % MOSEK Version 6.0.0.106 (Build date: 2011-3-17 10:46:54)
0180 %        pat = 'Version (\.*\d)+.*Build date: (\d\d\d\d-\d\d-\d\d)';
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

Generated on Mon 26-Jan-2015 15:21:31 by m2html © 2005