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

Generated on Fri 16-Dec-2016 12:45:37 by m2html © 2005