function r83s_res_test ( )

%*****************************************************************************80
%
%% R83S_RES_TEST tests R83S_RES.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    06 September 2015
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'R83S_RES_TEST\n' );
  fprintf ( 1, '  R83S_RES computes b-A*x, where A is an R83S matrix.\n' );
  fprintf ( 1, '  We check three cases, M<N, M=N, M>N.\n' );

  for i = 1 : 3

    if ( i == 1 )
      m = 3;
      n = 5;
    elseif ( i == 2 )
      m = 5;
      n = 5;
    elseif ( i == 3 )
      m = 5;
      n = 3;
    end

    seed = 123456789;
    [ a, seed ] = r83s_random ( m, n, seed );
    x = r8vec_indicator1 ( n );
    b = r83s_mv ( m, n, a, x );
    r = r83s_res ( m, n, a, x, b );
    r8vec_print ( m, r, '  Residual A*x-b:' );

  end

  return
end
