function lutx_test ( )

%*****************************************************************************80
%
%% lutx_test tests lutx.
%
%  Licensing:
%
%    This code is distributed under the MIT license. 
%
%  Modified:
%
%    06 January 2020
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'lutx_test\n' );
  fprintf ( 1, '  lutx Lu-factors a linear system.\n' );
%
%  Set the array.
%
  A = [ 1, 2, 3; ...
        4, 5, 6; ...
        7, 8, 0 ];

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Matrix A:\n' );
  fprintf ( 1, '\n' );
  disp ( A );
%
%  Request the factors.
%
  [L,U,p] = lutx ( A );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  L factor:\n' );
  fprintf ( 1, '\n' );
  disp ( L );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  U factor:\n' );
  fprintf ( 1, '\n' );
  disp ( U );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  P factor:\n' );
  fprintf ( 1, '\n' );
  P = eye(size(A));
  P = P(p,:);
  disp ( P );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  P''*L*U:\n' );
  fprintf ( 1, '\n' );
  disp ( P' * L * U );

  return
end

