function r8mat_plu_test ( )

%*****************************************************************************80
%
%% r8mat_plu_test() tests r8mat_plu().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    04 November 2021
%
%  Author:
%
%    John Burkardt
%
  m = 5;
  n = 5;

  x = [ 1.0, 10.0, 4.0, 2.0, 3.0 ];

  fprintf ( 1, '\n' );
  fprintf ( 1, 'r8mat_plu_test():\n' );
  fprintf ( 1, '  r8mat_plu() computes the PLU factors of a matrix.\n' );

  a = r8mat_vand2 ( n, n, x );

  r8mat_print ( m, n, a, '  Matrix to be factored:' );

  [ p, l, u ] = r8mat_plu ( a );

  r8mat_print ( m, m, p, '  P factor:' );

  r8mat_print ( m, m, l, '  L factor:' );
 
  r8mat_print ( m, n, u, '  U factor:' );
 
  plu(1:m,1:n) = p(1:m,1:m)' * ( l(1:m,1:m) * u(1:m,1:n) );

  r8mat_print ( m, n, plu, '  P*L*U:' );

  return
end
