function derange1_check_test ( )

%*****************************************************************************80
%
%% DERANGE1_CHECK_TEST tests DERANGE1_CHECK.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license. 
%
%  Modified:
%
%    02 June 2015
%
%  Author:
%
%    John Burkardt
%
  n = 5;

  a_test = [ ...
    2, 3, 4, 5, 1; ...
    2, 5, 3, 1, 4; ...
    2, 3, 4, 1, 4; ...
    0, 3, 4, 5, 1; ...
    1, 4, 9, 2, 3 ]';

  fprintf ( 1, '\n' );
  fprintf ( 1, 'DERANGE1_CHECK_TEST\n' );
  fprintf ( 1, '  DERANGE1_CHECK_checks whether a vector of N objects\n' );
  fprintf ( 1, '  represents a derangement of (1,...,N).\n' );
 
  for j = 1 : 5
 
    for i = 1 : n
      a(i) = a_test(i,j);
    end

    i4vec_transpose_print ( n, a, '  Potential derangement:' );
    check = derange1_check ( n, a );
    fprintf ( 1, '  CHECK = %d\n', check );

  end

  return
end
