Home > matpower4.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, 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.44 2011/02/07 21:32:02 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.0', ...
0052                 'Release',  '', ...
0053                 'Date',     '07-Feb-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('minopf')
0111         if exist('minopfver', 'file') == 2
0112             minopfver;
0113         else
0114             fprintf('%-22s Version 3.0b2 or earlier\n', 'MINOPF');
0115         end
0116     else
0117         fprintf('%-22s -- not installed --\n', 'MINOPF');
0118     end
0119     if have_fcn('mosek')
0120         pat = 'Version (\.*\d)+.*Build date: (\d\d\d\d-\d\d-\d\d)';
0121         [s,e,tE,m,t] = regexp(evalc('mosekopt'), pat);
0122           if isempty(t)
0123             vn = '<unknown>';
0124             d  = '';
0125         else
0126             vn = t{1}{1};
0127             d  = datestr(t{1}{2}, 'dd-mmm-yyyy');
0128         end
0129          fprintf('%-22s Version %-10s %-11s   %s\n', 'MOSEK', vn, d, computer);
0130     else
0131         fprintf('%-22s -- not installed --\n', 'MOSEK');
0132     end
0133     if have_fcn('pdipmopf')
0134         pdipmopfver;
0135     else
0136         fprintf('%-22s -- not installed --\n', 'PDIPMOPF');
0137     end
0138     if have_fcn('scpdipmopf')
0139         scpdipmopfver;
0140     else
0141         fprintf('%-22s -- not installed --\n', 'SCPDIPMOPF');
0142     end
0143     if have_fcn('tralmopf')
0144         tralmopfver;
0145     else
0146         fprintf('%-22s -- not installed --\n', 'TRALMOPF');
0147     end
0148 
0149     fprintf('%-22s %s\n\n', 'Architecture:', computer);
0150     
0151     fprintf('  MATPOWER %s is distributed under the GNU General Public License.\n', v{1}.Version);
0152     fprintf('  Please see the LICENSE and COPYING files for details.\n\n');
0153 end

Generated on Mon 26-Jan-2015 14:56:45 by m2html © 2005