Home > matpower7.0 > 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.0', ...
0030                 'Release',  '', ...
0031                 'Date',     '20-Jun-2019' );
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_fcn('octave')
0040         v{2} = ver('octave');
0041     else
0042         v{2} = ver('matlab');
0043         if length(v{2}) > 1
0044             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.');
0045             v{2} = v{2}(1);
0046         end
0047     end
0048     v{3} = ver('optim');
0049     if length(v{3}) > 1
0050         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.');
0051         v{3} = v{3}(1);
0052     end
0053     for n = 1:3
0054         if n == 3
0055             if isempty(v{3}) || isempty(v{3}.Version)
0056                 if have_fcn('matlab')
0057                     fprintf('\n%-22s -- not installed --', 'Optimization Toolbox');
0058                 else    %% Octave
0059                     fprintf('\n%-22s -- not installed --', 'optim');
0060                 end
0061                 continue;
0062             elseif have_fcn('matlab') && ~license('test', 'optimization_toolbox')
0063                 fprintf('\n%-22s -- no license --', 'Optimization Toolbox');
0064                 continue;
0065             end
0066         end
0067         fprintf('\n%-22s Version %-9s', v{n}.Name, v{n}.Version);
0068         if ~isempty(v{n}.Date)
0069             fprintf('  %11s', v{n}.Date);
0070             if ~isempty(v{n}.Release)
0071                 fprintf('   Release: %-10s', v{n}.Release);
0072             end
0073         end
0074     end
0075     fprintf('\n');
0076     if have_fcn('e4st')
0077         e4st_ver;
0078     end
0079     mipsver;
0080     if have_fcn('most')
0081         mostver;
0082     else
0083         fprintf('%-22s -- not installed --\n', 'MOST');
0084     end
0085     if have_fcn('sdp_pf')
0086         sdp_pf_ver;
0087     else
0088         fprintf('%-22s -- not installed --\n', 'SDP_PF');
0089     end
0090     if have_fcn('syngrid')
0091         sgver;
0092     else
0093         fprintf('%-22s -- not installed --\n', 'SynGrid');
0094     end
0095     if have_fcn('yalmip')
0096         s = have_fcn('yalmip', 'all');
0097         fprintf('%-22s Version %-10s %-11s\n', 'YALMIP', s.vstr, s.date);
0098     else
0099         fprintf('%-22s -- not installed --\n', 'YALMIP');
0100     end
0101     if have_fcn('knitro')
0102         s = have_fcn('knitro', 'all');
0103         if isempty(s.vstr)
0104             vn = '<unknown>';
0105         else
0106             vn = s.vstr;
0107         end
0108         fprintf('%-22s Version %-10s %-11s\n', 'Artelys Knitro', vn, s.date);
0109     else
0110         fprintf('%-22s -- not installed --\n', 'Artelys Knitro');
0111     end
0112     if have_fcn('bpmpd')
0113         if exist('bpver', 'file') == 2
0114             bpver;
0115         else
0116             fprintf('%-22s Version 2.21 or earlier\n', 'BPMPD_MEX');
0117         end
0118     else
0119         fprintf('%-22s -- not installed --\n', 'BPMPD_MEX');
0120     end
0121     if have_fcn('clp')
0122         s = have_fcn('clp', 'all');
0123         if isempty(s.vstr)
0124             vn = '<unknown>';
0125         else
0126             vn = s.vstr;
0127         end
0128         fprintf('%-22s Version %-10s %-11s\n', 'CLP', vn, s.date);
0129     else
0130         fprintf('%-22s -- not installed --\n', 'CLP');
0131     end
0132     if have_fcn('cplex')
0133         s = have_fcn('cplex', 'all');
0134         fprintf('%-22s Version %-10s %-11s\n', 'CPLEX', s.vstr, s.date);
0135     else
0136         fprintf('%-22s -- not installed --\n', 'CPLEX');
0137     end
0138     if have_fcn('glpk')
0139         s = have_fcn('glpk', 'all');
0140         if isempty(s.vstr)
0141             vn = '<unknown>';
0142         else
0143             vn = s.vstr;
0144         end
0145         fprintf('%-22s Version %-10s %-11s\n', 'GLPK', vn, s.date);
0146     else
0147         fprintf('%-22s -- not installed --\n', 'GLPK');
0148     end
0149     gurobiver;
0150     if have_fcn('ipopt')
0151         s = have_fcn('ipopt', 'all');
0152         if isempty(s.vstr)
0153             vn = '<unknown>';
0154         else
0155             vn = s.vstr;
0156         end
0157         fprintf('%-22s Version %-10s %-11s\n', 'IPOPT', vn, s.date);
0158     else
0159         fprintf('%-22s -- not installed --\n', 'IPOPT');
0160     end
0161     if have_fcn('minopf')
0162         if exist('minopfver', 'file') == 2
0163             minopfver;
0164         else
0165             fprintf('%-22s Version 3.0b2 or earlier\n', 'MINOPF');
0166         end
0167     else
0168         fprintf('%-22s -- not installed --\n', 'MINOPF');
0169     end
0170     if have_fcn('mosek')
0171         s = have_fcn('mosek', 'all');
0172         if isempty(s.vstr)
0173             vn = '<unknown>';
0174         else
0175             vn = s.vstr;
0176         end
0177         fprintf('%-22s Version %-10s %-11s\n', 'MOSEK', vn, s.date);
0178     else
0179         fprintf('%-22s -- not installed --\n', 'MOSEK');
0180     end
0181     if have_fcn('pardiso')
0182         s = have_fcn('pardiso', 'all');
0183         if isempty(s.vstr)
0184             vn = '<unknown>';
0185         else
0186             vn = s.vstr;
0187         end
0188         fprintf('%-22s Version %-10s %-11s\n', 'PARDISO', vn, s.date);
0189     else
0190         fprintf('%-22s -- not installed --\n', 'PARDISO');
0191     end
0192     if have_fcn('pdipmopf')
0193         pdipmopfver;
0194     else
0195         fprintf('%-22s -- not installed --\n', 'PDIPMOPF');
0196     end
0197     if have_fcn('scpdipmopf')
0198         scpdipmopfver;
0199     else
0200         fprintf('%-22s -- not installed --\n', 'SCPDIPMOPF');
0201     end
0202     if have_fcn('sdpt3')
0203         s = have_fcn('sdpt3', 'all');
0204         if isempty(s.vstr)
0205             vn = '<unknown>';
0206         else
0207             vn = s.vstr;
0208         end
0209         fprintf('%-22s Version %-10s %-11s\n', 'SDPT3', vn, s.date);
0210     else
0211         fprintf('%-22s -- not installed --\n', 'SDPT3');
0212     end
0213     if have_fcn('sedumi')
0214         s = have_fcn('sedumi', 'all');
0215         if isempty(s.vstr)
0216             vn = '<unknown>';
0217         else
0218             vn = s.vstr;
0219         end
0220         fprintf('%-22s Version %-10s %-11s\n', 'SeDuMi', vn, s.date);
0221     else
0222         fprintf('%-22s -- not installed --\n', 'SeDuMi');
0223     end
0224     if have_fcn('tralmopf')
0225         tralmopfver;
0226     else
0227         fprintf('%-22s -- not installed --\n', 'TRALMOPF');
0228     end
0229 
0230     fprintf('%-22s %s\n\n', 'Architecture:', computer);
0231     
0232     fprintf('  MATPOWER %s is distributed under the 3-clause BSD License.\n', v{1}.Version);
0233     fprintf('  Please see the LICENSE file for details.\n\n');
0234 end

Generated on Mon 24-Jun-2019 15:58:45 by m2html © 2005