function is_it = is_invalid(points)
% IS_INVALID: Boolean function indicating if a sequence of
%             points is *not* sorted, i.e. is not monotonically
%             increasing and hence invalid.
%
% Code written by Katherine Smith, 2003
%
%    GENERAL
%
%      is_it = is_invalid(points)
%
%    INPUT/S
%
%      -points:
%           The bump points.
%
%    OUTPUT/S
%
%      -is_it:
%           equals 1 if points are invalid, 0 otherwsie
%
%    PENDING WORK
%
%      -Add a few comments to file.
%
%    KNOWN BUG/S
%
%      -None.
%
%    COMMENT/S
%
%      -Should return 'yes' or 'no' rather than 0 and 1 which
%       (I believe) is bad Matlab practice.
%
%    RELATED FUNCTION/S
%
%      BUILD_1D_MODEL
%
%    ABOUT
%
%      -Created:     November 23rd, 2003
%      -Last update: Novermber 25th, 2003
%      -Revision:    0.0.2
%      -Author:      R. S. Schestowitz, University of Manchester
% ==============================================================

[dummy, order] = sort(points); % sort it
if(any(order' ~= 1:size(points,1))) % if any point after ordering does not correspond
             % to its position (numbered 1..maxsize)
  is_it = 1;
else
  is_it = 0;
end