function r8ge_np_det_test ( )

%*****************************************************************************80
%
%% R8GE_NP_DET_TEST tests R8GE_NP_DET.
%
%  Licensing:
%
%    This code is distributed under the MIT license. 
%
%  Modified:
%
%    06 June 2016
%
%  Author:
%
%    John Burkardt
%
  n = 10;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'R8GE_NP_DET_TEST\n' );
  fprintf ( 1, '  R8GE_NP_DET computes the determinant of a matrix\n' );
  fprintf ( 1, '  that was factored by R8GE_NP_FA,\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Matrix order N = %d\n', n );
%
%  Set the matrix.
%
  a = r8ge_dif2 ( n, n );
%
%  Factor the matrix.
%
  [ a, info ] = r8ge_np_fa ( n, a );

  if ( info ~= 0 )
    fprintf ( 1, '\n' );
    fprintf ( 1, 'R8GE_NP_DET_TEST - Fatal error!\n' );
    fprintf ( 1, '  R8GE_NP_FA declares the matrix is singular!\n' );
    fprintf ( 1, '  The value of INFO is %d\n', info );
    return
  end
%
%  Get the determinant.
%
  det = r8ge_np_det ( n, a );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Determinant of -1, 2, -1 matrix is %g\n', det );
  fprintf ( 1, '  Exact value is %g\n', n + 1 );

  return
end
