function r8ge_plu_test ( )

%*****************************************************************************80
%
%% r8ge_plu_test() tests r8ge_plu().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    08 February 2016
%
%  Author:
%
%    John Burkardt
%
  m = 5;
  n = 4;
  
  fprintf ( 1, '\n' );
  fprintf ( 1, 'R8GE_PLU_TEST\n' );
  fprintf ( 1, '  R8GE_PLU returns the PLU factors of an R8GE matrix.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Matrix rows M =    %d\n', m );
  fprintf ( 1, '  Matrix columns N = %d\n', n );

  a = r8ge_random ( m, n );

  r8ge_print ( m, n, a, '  Matrix A:' );
%
%  Compute the PLU factors.
%
  [ p, l, u ] = r8ge_plu ( m, n, a );

  r8ge_print ( m, m, p, '  Factor P:' );

  r8ge_print ( m, m, l, '  Factor L:' );

  r8ge_print ( m, n, u, '  Factor U:' );

  plu(1:m,1:n) = p(1:m,1:m) * ( l(1:m,1:m) * u(1:m,1:n) );
        
  r8ge_print ( m, n, plu, '  Product P*L*U:');

  return
end
