Home > matpower7.1 > mp-opt-model > lib > have_feature_optim.m

have_feature_optim

PURPOSE ^

HAVE_FEATURE_OPTIM Detect availability/version info for Optimization Toolbox

SYNOPSIS ^

function [TorF, vstr, rdate] = have_feature_optim()

DESCRIPTION ^

HAVE_FEATURE_OPTIM  Detect availability/version info for Optimization Toolbox

   Feature detection function implementing 'optim' tag for HAVE_FEATURE
   to detect availability/version of the Optimization Toolbox.

   See also HAVE_FEATURE.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [TorF, vstr, rdate] = have_feature_optim()
0002 %HAVE_FEATURE_OPTIM  Detect availability/version info for Optimization Toolbox
0003 %
0004 %   Feature detection function implementing 'optim' tag for HAVE_FEATURE
0005 %   to detect availability/version of the Optimization Toolbox.
0006 %
0007 %   See also HAVE_FEATURE.
0008 
0009 %   MP-Opt-Model
0010 %   Copyright (c) 2004-2020, Power Systems Engineering Research Center (PSERC)
0011 %   by Ray Zimmerman, PSERC Cornell
0012 %
0013 %   This file is part of MP-Opt-Model.
0014 %   Covered by the 3-clause BSD License (see LICENSE file for details).
0015 %   See https://github.com/MATPOWER/mp-opt-model for more info.
0016 
0017 TorF = 0;
0018 vstr = '';
0019 rdate = '';
0020 matlab = have_feature('matlab');
0021 if ~matlab || (matlab && license('test', 'optimization_toolbox'))
0022     v = ver('optim');
0023     if length(v) > 1
0024         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.');
0025         v = v(1);
0026     end
0027     if ~isempty(v) && ~isempty(v.Version)
0028         TorF = 1;
0029         vstr = v.Version;
0030         rdate = v.Date;
0031     end
0032 end

Generated on Fri 09-Oct-2020 11:21:31 by m2html © 2005