function r8pbu_res_test ( )

%*****************************************************************************80
%
%% R8PBU_RES_TEST tests R8PBU_RES.
%
%  Licensing:
%
%    This code is distributed under the MIT license. 
%
%  Modified:
%
%    03 June 2016
%
%  Author:
%
%    John Burkardt
%
  m = 5;
  n = m;
  mu = 2;
  seed = 123456789;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'R8PBU_RES_TEST\n' );
  fprintf ( 1, '  R8PBU_RES returns the residual b-A*x where A is\n' );
  fprintf ( 1, '  a positive definite symmetric band matrix.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Matrix order N =     %d\n', n );
  fprintf ( 1, '  Upper bandwidth MU = %d\n', mu );
%
%  Set the matrix values.
%
  [ a, seed ] = r8pbu_random ( n, mu, seed );
  r8pbu_print ( n, mu, a, '  Matrix A:' );
%
%  Set the desired solution.
%
  x = r8vec_indicator1 ( n );
  r8vec_print ( n, x, '  Exact solution x:' );
%
%  Compute the right hand side.
%
  b = r8pbu_mv ( n, mu, a, x );
  r8vec_print ( n, b, '  Right hand side b:' );
%
%  Jostle the solution.
%
  [ e, seed ] = r8vec_uniform_01 ( n, seed );
  x2(1:n) = x(1:n) + 0.01 * e(1:n);
  r8vec_print ( n, x2, '  Approximate solution x2:' );
%
%  Compute the residual.
%
  r = r8pbu_res ( m, n, mu, a, x2, b );
 
  r8vec_print ( n, r, '  Residual r = b-A*x2:' );
 
  return
end
