function r8pp_fa_test ( )

%*****************************************************************************80
%
%% R8PP_FA_TEST tests R8PP_FA.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    14 March 2009
%
%  Author:
%
%    John Burkardt
%
  n = 5;
  seed = 123456789;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'R8PP_FA_TEST\n' );
  fprintf ( 1, '  R8PP_FA factors an R8PP system,\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Matrix order N = %d\n', n );
%
%  Set the matrix.
%
  [ a, seed ] = r8pp_random ( n, seed );

  r8pp_print ( n, a, '  The R8PP matrix:' );
%
%  Set the desired solution.
%
  x = r8vec_indicator1 ( n );

  r8vec_print ( n, x, '  The desired solution:' );
%
%  Compute the corresponding right hand side.
%
  b = r8pp_mv ( n, a, x );

  r8vec_print ( n, b, '  The right hand side:' );
%
%  Factor the matrix.
%
  [ a_lu, info ] = r8pp_fa ( n, a );

  if ( info ~= 0 )
    fprintf ( 1, '\n' );
    fprintf ( 1, 'R8PP_FA_TEST - Fatal error!\n' );
    fprintf ( 1, '  R8PP_FA declares the matrix is singular!\n' );
    fprintf ( 1, '  The value of INFO is %d\n', info );
    return
  end

  fprintf ( 1, '\n' );
  fprintf ( 1, '  The R8PP matrix has been factored.\n' );
%
%  Solve the linear system.
%
  x = r8pp_sl ( n, a_lu, b );
 
  r8vec_print ( n, x, '  Solution:' );

  return
end
