Home > matpower7.1 > lib > 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 %   Copyright (c) 2005-2019, Power Systems Engineering Research Center (PSERC)
0012 %   by Ray Zimmerman, PSERC Cornell
0013 %
0014 %   This file is part of MATPOWER.
0015 %   Covered by the 3-clause BSD License (see LICENSE file for details).
0016 %   See https://matpower.org for more info.
0017 
0018 %% the following only works if MATPOWER is explicitly in the path,
0019 %% but not if it is only in the current working directory
0020 % fs = filesep;
0021 % p = fileparts(which('runpf'));
0022 % if ~strcmp(p(1),fs)
0023 %   [t, p] = strtok(p, filesep);
0024 % end
0025 % p = p(2:end);
0026 % v{1} = ver(p);
0027 
0028 v{1} = struct(  'Name',     'MATPOWER', ... 
0029                 'Version',  '7.1', ...
0030                 'Release',  '', ...
0031                 'Date',     '08-Oct-2020' );
0032 if nargout > 0
0033     if nargin > 0
0034         rv = v{1};
0035     else
0036         rv = v{1}.Version;
0037     end
0038 else
0039     if have_feature('octave')
0040         % v{2} = ver('octave');
0041         %% workaround for https://savannah.gnu.org/bugs/index.php?59125
0042         vv = ver;
0043         for k = 1:length(vv)
0044             if strcmp(vv(k).Name, 'Octave')
0045                 v{2} = vv(k);
0046                 break;
0047             end
0048         end
0049         %% convert to consistent format
0050         if ~isempty(v{2}.Date)
0051             v{2}.Date = datestr(v{2}.Date, 'dd-mmm-yyyy');
0052         end
0053     else
0054         v{2} = ver('matlab');
0055         if length(v{2}) > 1
0056             warning('The built-in VER command is behaving strangely, probably as a result of installing a 3rd party toolbox in a directory named ''matlab'' on your path. Check each element of the output of ver(''matlab'') to find the offending toolbox, then move the toolbox to a more appropriately named directory.');
0057             v{2} = v{2}(1);
0058         end
0059     end
0060     v{3} = ver('optim');
0061     if length(v{3}) > 1
0062         warning('The built-in VER command is behaving strangely, probably as a result of installing a 3rd party toolbox in a directory named ''optim'' on your path. Check each element of the output of ver(''optim'') to find the offending toolbox, then move the toolbox to a more appropriately named directory.');
0063         v{3} = v{3}(1);
0064     end
0065     for n = 1:3
0066         if n == 3
0067             if isempty(v{3}) || isempty(v{3}.Version)
0068                 if have_feature('matlab')
0069                     fprintf('\n%-22s -- not installed --', 'Optimization Toolbox');
0070                 else    %% Octave
0071                     fprintf('\n%-22s -- not installed --', 'optim');
0072                 end
0073                 continue;
0074             elseif have_feature('matlab') && ~license('test', 'optimization_toolbox')
0075                 fprintf('\n%-22s -- no license --', 'Optimization Toolbox');
0076                 continue;
0077             end
0078         end
0079         fprintf('\n%-22s Version %-9s', v{n}.Name, v{n}.Version);
0080         if ~isempty(v{n}.Date)
0081             fprintf('  %11s', v{n}.Date);
0082             if ~isempty(v{n}.Release)
0083                 fprintf('   Release: %-10s', v{n}.Release);
0084             end
0085         end
0086     end
0087     fprintf('\n');
0088     mptestver;
0089     mipsver;
0090     mpomver;
0091     if have_feature('most')
0092         mostver;
0093     else
0094         fprintf('%-22s -- not installed --\n', 'MOST');
0095     end
0096     if have_feature('e4st')
0097         e4st_ver;
0098     end
0099     if have_feature('sdp_pf')
0100         sdp_pf_ver;
0101     else
0102         fprintf('%-22s -- not installed --\n', 'SDP_PF');
0103     end
0104     if have_feature('syngrid')
0105         sgver;
0106     else
0107         fprintf('%-22s -- not installed --\n', 'SynGrid');
0108     end
0109     if have_feature('knitro')
0110         s = have_feature('knitro', 'all');
0111         if isempty(s.vstr)
0112             vn = '<unknown>';
0113         else
0114             vn = s.vstr;
0115         end
0116         fprintf('%-22s Version %-10s %-11s\n', 'Artelys Knitro', vn, s.date);
0117     else
0118         fprintf('%-22s -- not installed --\n', 'Artelys Knitro');
0119     end
0120     if have_feature('bpmpd')
0121         if exist('bpver', 'file') == 2
0122             bpver;
0123         else
0124             fprintf('%-22s Version 2.21 or earlier\n', 'BPMPD_MEX');
0125         end
0126     else
0127         fprintf('%-22s -- not installed --\n', 'BPMPD_MEX');
0128     end
0129     if have_feature('clp')
0130         s = have_feature('clp', 'all');
0131         if isempty(s.vstr)
0132             vn = '<unknown>';
0133         else
0134             vn = s.vstr;
0135         end
0136         fprintf('%-22s Version %-10s %-11s\n', 'CLP', vn, s.date);
0137     else
0138         fprintf('%-22s -- not installed --\n', 'CLP');
0139     end
0140     if have_feature('cplex')
0141         s = have_feature('cplex', 'all');
0142         fprintf('%-22s Version %-10s %-11s\n', 'CPLEX', s.vstr, s.date);
0143     else
0144         fprintf('%-22s -- not installed --\n', 'CPLEX');
0145     end
0146     if have_feature('glpk')
0147         s = have_feature('glpk', 'all');
0148         if isempty(s.vstr)
0149             vn = '<unknown>';
0150         else
0151             vn = s.vstr;
0152         end
0153         fprintf('%-22s Version %-10s %-11s\n', 'GLPK', vn, s.date);
0154     else
0155         fprintf('%-22s -- not installed --\n', 'GLPK');
0156     end
0157     gurobiver;
0158     if have_feature('ipopt')
0159         s = have_feature('ipopt', 'all');
0160         if isempty(s.vstr)
0161             vn = '<unknown>';
0162         else
0163             vn = s.vstr;
0164         end
0165         fprintf('%-22s Version %-10s %-11s\n', 'IPOPT', vn, s.date);
0166     else
0167         fprintf('%-22s -- not installed --\n', 'IPOPT');
0168     end
0169     if have_feature('minopf')
0170         if exist('minopfver', 'file') == 2
0171             minopfver;
0172         else
0173             fprintf('%-22s Version 3.0b2 or earlier\n', 'MINOPF');
0174         end
0175     else
0176         fprintf('%-22s -- not installed --\n', 'MINOPF');
0177     end
0178     if have_feature('mosek')
0179         s = have_feature('mosek', 'all');
0180         if isempty(s.vstr)
0181             vn = '<unknown>';
0182         else
0183             vn = s.vstr;
0184         end
0185         fprintf('%-22s Version %-10s %-11s\n', 'MOSEK', vn, s.date);
0186     else
0187         fprintf('%-22s -- not installed --\n', 'MOSEK');
0188     end
0189     osqpver;
0190     if have_feature('pardiso')
0191         s = have_feature('pardiso', 'all');
0192         if isempty(s.vstr)
0193             vn = '<unknown>';
0194         else
0195             vn = s.vstr;
0196         end
0197         fprintf('%-22s Version %-10s %-11s\n', 'PARDISO', vn, s.date);
0198     else
0199         fprintf('%-22s -- not installed --\n', 'PARDISO');
0200     end
0201     if have_feature('pdipmopf')
0202         pdipmopfver;
0203     else
0204         fprintf('%-22s -- not installed --\n', 'PDIPMOPF');
0205     end
0206     if have_feature('scpdipmopf')
0207         scpdipmopfver;
0208     else
0209         fprintf('%-22s -- not installed --\n', 'SCPDIPMOPF');
0210     end
0211     if have_feature('sdpt3')
0212         s = have_feature('sdpt3', 'all');
0213         if isempty(s.vstr)
0214             vn = '<unknown>';
0215         else
0216             vn = s.vstr;
0217         end
0218         fprintf('%-22s Version %-10s %-11s\n', 'SDPT3', vn, s.date);
0219     else
0220         fprintf('%-22s -- not installed --\n', 'SDPT3');
0221     end
0222     if have_feature('sedumi')
0223         s = have_feature('sedumi', 'all');
0224         if isempty(s.vstr)
0225             vn = '<unknown>';
0226         else
0227             vn = s.vstr;
0228         end
0229         fprintf('%-22s Version %-10s %-11s\n', 'SeDuMi', vn, s.date);
0230     else
0231         fprintf('%-22s -- not installed --\n', 'SeDuMi');
0232     end
0233     if have_feature('tralmopf')
0234         tralmopfver;
0235     else
0236         fprintf('%-22s -- not installed --\n', 'TRALMOPF');
0237     end
0238     if have_feature('yalmip')
0239         s = have_feature('yalmip', 'all');
0240         fprintf('%-22s Version %-10s %-11s\n', 'YALMIP', s.vstr, s.date);
0241     else
0242         fprintf('%-22s -- not installed --\n', 'YALMIP');
0243     end
0244 
0245     fprintf('%-22s %s\n\n', 'Architecture:', computer);
0246     
0247     fprintf('  MATPOWER %s is distributed under the 3-clause BSD License.\n', v{1}.Version);
0248     fprintf('  Please see the LICENSE file for details.\n\n');
0249 end

Generated on Fri 09-Oct-2020 11:21:31 by m2html © 2005