function bssorderok(m)
% BSSPARTITIONSIZEOK - Check the nominal partition size for a B-spline
% series for validity
%
% INPUTS:
%
%    m:
%       The order of the bsplines to be used. This must be an integer scalar
%       value greater than zero (M>=1).
%
%       This is a scalar.
%
%       M must:
%
%         be nonempty
%         be numeric
%         be >= 1
%         and be a whole number
%
% OUTPUTS:
%
%   None.
%

%
% Copyright 2014-2023 Biometrics Northwest LLC
%

%
% Modified: 2023-02-13
% Author : Kevin R. Gehringer
%
%    Fixed the outputs to reflect that there are no outputs.
%
% Modified: 2022-12-18
% Author : Kevin R. Gehringer
%
%    Removed the output flag. It was not necessary since the function
%    signals errors. If it returns without an error all is OK.
%
%    Changed the rounding function from fix() to floor() since the B-spline
%    order must be positive.
%
% Created: 2014-11-25
% Author : Kevin R. Gehringer
%

%
% Begin the testing with nonempty and numeric.
%
if ( isempty(m) )
   error('The B-spline series order was empty.');
end

if ( ~isnumeric(m) )
   error('The B-spline series order was not numeric.');
end

%
%  Check to see if N is a scalar. 
%
if ( ~isscalar(m) )
   error('The B-spline series order was not a scalar value.');
end

%
% The order must be at least 1.
%
if ( m < 1 )
   error('The B-spline series order must >= 1.');
end

%
% Check to see that M is a whole number by rounding toward zero.
%
if ( (m-floor(m)) ~= 0 )
   error('The order for the B-Spline series (%g) was not an integer value.',m);
end
