function r8mat_ut_solve_test ( )

%*****************************************************************************80
%
%% r8mat_ut_solve_test() tests r8mat_ut_solve().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    28 July 2015
%
%  Author:
%
%    John Burkardt
%
  n = 4;

  a = [ ...
    1.0,  2.0,  4.0,  7.0; ...
    0.0,  3.0,  5.0,  8.0; ...
    0.0,  0.0,  6.0,  9.0; ...
    0.0,  0.0,  0.0, 10.0 ];
  b = [ 1.0; 8.0; 32.0; 90.0 ];

  fprintf ( 1, '\n' );
  fprintf ( 1, 'R8MAT_UT_SOLVE_TEST\n' );
  fprintf ( 1, '  R8MAT_UT_SOLVE solves a transposed upper triangular system.\n' );

  r8mat_print ( n, n, a, '  Input matrix A:' );

  r8vec_print ( n, b, '  Right hand side b:' );

  x = r8mat_ut_solve ( n, a, b );

  r8vec_print ( n, x, '  Computed solution x:' );

  r = a' * x - b;

  rnorm = norm ( r );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Norm of A''*x-b = %g\n', rnorm );

  return
end
