www.gusucode.com > mbcdata 工具箱 matlab 源码程序 > mbcdata/@cgtabgradconstraint/getStaticExpressions.m

    function [pExpr, EvalFuncs] = getStaticExpressions(obj, type)
%GETSTATICEXPRESSIONS Get expressions that are required by static methods
%
%  [PEXPR, EVALFUNCS] = GETSTATICEXPRESSIONS(OBJ) returns a list of
%  expression pointers and associated evaluation functions for each one.
%  These expression/function pairs are the ones that the item will need
%  access to in its static methods.
%
%  [PEXPR, EVALFUNCS] = GETSTATICEXPRESSIONS(OBJ, OP) specifies the
%  operation that the static data is required for.  The default value is
%  'Evaluate'.  All items also support 'NaturalEvaluate'.  Constraints also
%  support 'LHSEvaluate' and 'RHSEvaluate'.

%   Copyright 2006-2009 The MathWorks, Inc.


if obj.IsVariable
    % free variable so no model evaluations required
    pExpr = mbcpointer(1, 0);
    EvalFuncs = {};
else
    % model evaluation required
    pExpr = obj.pItem;
    EvalFuncs = {'evalAtInputs'};
end