Home > matpower4.1 > 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, the Optimization Toolbox, MIPS
   and any optional MATPOWER packages such as BPMPD_MEX, IPOPT, MINOPF,
   PDIPMOPF, SCPDIPMOPF and TRAMLOPF.

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, the Optimization Toolbox, MIPS
0008 %   and any optional MATPOWER packages such as BPMPD_MEX, IPOPT, MINOPF,
0009 %   PDIPMOPF, SCPDIPMOPF and TRAMLOPF.
0010 
0011 %   MATPOWER
0012 %   $Id: mpver.m,v 1.54 2011/12/14 17:07:47 cvs Exp $
0013 %   by Ray Zimmerman, PSERC Cornell
0014 %   Copyright (c) 2005-2011 by Power System Engineering Research Center (PSERC)
0015 %
0016 %   This file is part of MATPOWER.
0017 %   See http://www.pserc.cornell.edu/matpower/ for more info.
0018 %
0019 %   MATPOWER is free software: you can redistribute it and/or modify
0020 %   it under the terms of the GNU General Public License as published
0021 %   by the Free Software Foundation, either version 3 of the License,
0022 %   or (at your option) any later version.
0023 %
0024 %   MATPOWER is distributed in the hope that it will be useful,
0025 %   but WITHOUT ANY WARRANTY; without even the implied warranty of
0026 %   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0027 %   GNU General Public License for more details.
0028 %
0029 %   You should have received a copy of the GNU General Public License
0030 %   along with MATPOWER. If not, see <http://www.gnu.org/licenses/>.
0031 %
0032 %   Additional permission under GNU GPL version 3 section 7
0033 %
0034 %   If you modify MATPOWER, or any covered work, to interface with
0035 %   other modules (such as MATLAB code and MEX-files) available in a
0036 %   MATLAB(R) or comparable environment containing parts covered
0037 %   under other licensing terms, the licensors of MATPOWER grant
0038 %   you additional permission to convey the resulting work.
0039 
0040 %% the following only works if MATPOWER is explicitly in the path,
0041 %% but not if it is only in the current working directory
0042 % fs = filesep;
0043 % p = fileparts(which('runpf'));
0044 % if ~strcmp(p(1),fs)
0045 %   [t, p] = strtok(p, filesep);
0046 % end
0047 % p = p(2:end);
0048 % v{1} = ver(p);
0049 
0050 v{1} = struct(  'Name',     'MATPOWER', ... 
0051                 'Version',  '4.1', ...
0052                 'Release',  '', ...
0053                 'Date',     '14-Dec-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('gurobi')
0111         [x, f, e, o] = gurobi_mex(1, 1, [], [], [], 1, 1, 'C', ...
0112             struct('Display', 0, 'DisplayInterval', Inf));
0113         if isfield(o, 'Versions')
0114             vn = sprintf('%d.%d.%d/%.2f', o.Versions.LibMajor, ...
0115                 o.Versions.LibMinor, o.Versions.LibTechi, o.Versions.GurobiMex);
0116         elseif isfield(o, 'Lib.Ver.Major')
0117             vn = sprintf('%d.%d.%d/%.2f', o.('Lib.Ver.Major'), ...
0118                 o.('Lib.Ver.Minor'), o.('Lib.Ver.Techi'), o.('GurobiMex.Ver'));
0119         else
0120             vn = '<unknown>';
0121         end
0122         fprintf('%-22s Version %-10s %-11s   %s\n', 'Gurobi', vn, '', computer);
0123     else
0124         fprintf('%-22s -- not installed --\n', 'Gurobi');
0125     end
0126     if have_fcn('knitro')
0127         str = evalc('[x fval] = ktrlink(@(x)1,1);');
0128         pat = 'KNITRO ([^\s]+)\n';
0129         [s,e,tE,m,t] = regexp(str, pat);
0130         if isempty(t)
0131             vn = '<unknown>';
0132         else
0133             vn = t{1}{1};
0134         end
0135         fprintf('%-22s Version %-10s %-11s   %s\n', 'KNITRO', vn, '', computer);
0136     else
0137         fprintf('%-22s -- not installed --\n', 'KNITRO');
0138     end
0139     if have_fcn('minopf')
0140         if exist('minopfver', 'file') == 2
0141             minopfver;
0142         else
0143             fprintf('%-22s Version 3.0b2 or earlier\n', 'MINOPF');
0144         end
0145     else
0146         fprintf('%-22s -- not installed --\n', 'MINOPF');
0147     end
0148     if have_fcn('mosek')
0149         % (this code is also in qps_mosek.m)
0150         % MOSEK Version 6.0.0.93 (Build date: 2010-10-26 13:03:27)
0151         % MOSEK Version 6.0.0.106 (Build date: 2011-3-17 10:46:54)
0152 %        pat = 'Version (\.*\d)+.*Build date: (\d\d\d\d-\d\d-\d\d)';
0153         pat = 'Version (\.*\d)+.*Build date: (\d+-\d+-\d+)';
0154         [s,e,tE,m,t] = regexp(evalc('mosekopt'), pat);
0155         if isempty(t)
0156             vn = '<unknown>';
0157             d  = '';
0158         else
0159             vn = t{1}{1};
0160             d  = datestr(t{1}{2}, 'dd-mmm-yyyy');
0161         end
0162         fprintf('%-22s Version %-10s %-11s   %s\n', 'MOSEK', vn, d, computer);
0163     else
0164         fprintf('%-22s -- not installed --\n', 'MOSEK');
0165     end
0166     if have_fcn('pdipmopf')
0167         pdipmopfver;
0168     else
0169         fprintf('%-22s -- not installed --\n', 'PDIPMOPF');
0170     end
0171     if have_fcn('scpdipmopf')
0172         scpdipmopfver;
0173     else
0174         fprintf('%-22s -- not installed --\n', 'SCPDIPMOPF');
0175     end
0176     if have_fcn('tralmopf')
0177         tralmopfver;
0178     else
0179         fprintf('%-22s -- not installed --\n', 'TRALMOPF');
0180     end
0181 
0182     fprintf('%-22s %s\n\n', 'Architecture:', computer);
0183     
0184     fprintf('  MATPOWER %s is distributed under the GNU General Public License.\n', v{1}.Version);
0185     fprintf('  Please see the LICENSE and COPYING files for details.\n\n');
0186 end

Generated on Mon 26-Jan-2015 15:00:13 by m2html © 2005