function r83t_res_test ( )

%*****************************************************************************80
%
%% R83T_RES_TEST tests R83T_RES.
%
%  Licensing:
%
%    This code is distributed under the MIT license. 
%
%  Modified:
%
%    28 May 2016
%
%  Author:
%
%    John Burkardt
%
  m = 5;
  n = 5;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'R83T_RES_TEST\n' );
  fprintf ( 1, '  R83T_RES evaluates the residual given an approximate\n' );
  fprintf ( 1, '  solution of a linear system A*x=b.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  M = %d\n', m );
  fprintf ( 1, '  N = %d\n', n );
%
%  Set the matrix.
%
  a = r83t_dif2 ( m, n );

  r83t_print ( m, n, a, '  The R83T matrix A:' );

  x = r8vec_indicator1 ( n );

  b = r83t_mv ( m, n, a, x );

  r8vec_print ( m, b, '  The right hand side B:' );

  x = zeros ( n );
  x = r83t_cg ( n, a, b, x );

  r8vec_print ( n, x, '  The solution X:' );

  r = r83t_res ( m, n, a, x, b );

  r8vec_print ( m, r, '  The residual b-A*x:' )

  return
end

