function i4mat_elim_test ( )

%*****************************************************************************80
%
%% I4MAT_ELIM_TEST tests I4MAT_ELIM.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    14 April 2009
%
%  Author:
%
%    John Burkardt
%
  m = 5;
  n = 5;
  test_num = 3;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'I4MAT_ELIM_TEST\n' );
  fprintf ( 1, '  I4MAT_ELIM does exact Gauss elimination.\n' );
 
  for test = 1 : test_num
 
    if ( test == 1 )
 
      k = 0;
      for i = 1 : m
        for j = 1 : n
          k = k + 1;
          a(i,j) = k;
        end
      end
 
    elseif ( test == 2 )
 
      factor = 8 * 7 * 6 * 5 * 4 * 3 * 2;
 
      for i = 1 : m
        for j = 1 : n
          a(i,j) = factor / ( i + j - 1 );
        end
      end
 
    elseif ( test == 3 )
 
      for i = 1 : m
        for j = 1 : n
          a(i,j) = i * j;
        end
      end

    end
 
    i4mat_print ( m, n, a, '  The original matrix:' );
 
    a = i4mat_elim ( m, n, a );
 
    i4mat_print ( m, n, a, '  The matrix returned by I4MAT_ELIM:' );
 
  end
 
  return
end
