GUROBIVER Prints or returns GUROBI version info. V = GUROBIVER returns the current GUROBI version numbers. V = GUROBIVER('all') returns a struct with the fields Name, Version, Release and Date (all strings). Calling GUROBIVER without assigning the return value prints the version and release date of the current installation of GUROBI. See also MPVER, GUROBI.
0001 function rv = gurobiver(varargin) 0002 %GUROBIVER Prints or returns GUROBI version info. 0003 % V = GUROBIVER returns the current GUROBI version numbers. 0004 % V = GUROBIVER('all') returns a struct with the fields Name, Version, 0005 % Release and Date (all strings). Calling GUROBIVER without assigning the 0006 % return value prints the version and release date of the current 0007 % installation of GUROBI. 0008 % 0009 % See also MPVER, GUROBI. 0010 0011 % MP-Opt-Model 0012 % Copyright (c) 2010-2020, Power Systems Engineering Research Center (PSERC) 0013 % by Ray Zimmerman, PSERC Cornell 0014 % 0015 % This file is part of MP-Opt-Model. 0016 % Covered by the 3-clause BSD License (see LICENSE file for details). 0017 % See https://github.com/MATPOWER/mp-opt-model for more info. 0018 0019 g = have_feature('gurobi', 'all'); 0020 if ~g.av 0021 g.vstr = '<unknown>'; 0022 end 0023 0024 v = struct( 'Name', 'Gurobi', ... 0025 'Version', g.vstr, ... 0026 'Release', '', ... 0027 'Date', g.date ); 0028 if nargout > 0 0029 if nargin > 0 0030 rv = v; 0031 else 0032 rv = v.Version; 0033 end 0034 else 0035 if g.av 0036 fprintf('%-22s Version %-10s %-11s\n', v.Name, v.Version, v.Date); 0037 else 0038 fprintf('%-22s -- not installed --\n', v.Name); 0039 end 0040 end