function res = evalDec(this, val)
%

%   Copyright 1997-2009 The MathWorks, Inc.
try
res = false(numel(this.m_handles));

for idx = 1:numel(this.m_handles)
    cp = this.m_handles{idx};
    if isa(cp,'Sldv.Point')
        val = reshape(val,size(cp.getFlatValue));
        res(idx) = isequal(val,cp.getFlatValue);
    else        
        lVal = cp.getFlatLow;
        hVal = cp.getFlatHigh;
        val = reshape(val, size(lVal)); 
        
        %lVal, hVal and val can be arbitarily sized matrices. Reshape them
        %all to [1, numel(x)] to provide easy and faster iteration.
        numElem = numel(lVal);
        lVal = reshape(lVal, 1, numElem);
        hVal = reshape(hVal, 1, numElem);
        val = reshape(val, 1, numElem);
        
        
        %For vector inputs, check if the constraint on each input is satisfied
        tr = zeros(1, numElem);
        for vectIdx = 1:numElem
            tr(vectIdx) = (((lVal(vectIdx)  < val(vectIdx)) && (val(vectIdx) < hVal(vectIdx))) || ...
                 (cp.highIncluded && isequal(val(vectIdx), hVal(vectIdx))) || ...
                 (cp.lowIncluded && isequal(val(vectIdx), lVal(vectIdx))));
        end
        res(idx) = all(tr); 
    end
end
catch Mex
    Mex.message;
end

