www.gusucode.com > mbcdata 工具箱 matlab 源码程序 > mbcdata/@cgrangeconstraint/private/pIsScalarInfBound.m

    function out = pIsScalarInfBound(obj, bound)
%PISSCALARINFBOUND Check to see if bound is infinite
%
%   OUT = PISSCALARINFBOUND(OBJ, BOUND) checks to see if a scalar infinite
%   bound has been set. 

%   Copyright 2006 The MathWorks, Inc.

if isStaticMode(obj)
    data = getStaticData(obj, 'InfBounds');
    switch lower(bound)
        case 'upper'
            out = data(2);
        case 'lower'
            out = data(1);
    end
    
else
    switch lower(bound)
        case 'upper'
            out = i_CheckBound(obj.UpperBound.info);
        case 'lower'
            out = i_CheckBound(obj.LowerBound.info);
    end
end

%--------------------------------------------------------------------------
function stat = i_CheckBound(boundCon)
%--------------------------------------------------------------------------

[unused, code] = getvaluemode(boundCon);
stat = ~code && isinf(getrhsvalue(boundCon));