function toep_cholesky_upper_test ( )

%*****************************************************************************80
%
%% TOEP_CHOLESKY_UPPER_TEST tests TOEP_CHOLESKY_UPPER.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    27 January 2017
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'TOEP_CHOLESKY_UPPER_TEST\n' );
  fprintf ( 1, '  TOEP_CHOLESKY_UPPER computes the upper Cholesky\n' );
  fprintf ( 1, '  factor of a positive semi-definite Toeplitz matrix.\n' );
  fprintf ( 1, '  The Toeplitz matrix is supplied as a (2,N) array.\n' );

  n = 3;
  g = [ 1.0,   0.5, -0.375; ...
        0.0,   0.5, -0.375 ];

  r8mat_print ( 2, n, g, '  Compressed Toeplitz matrix G:' );

  r = toep_cholesky_upper ( n, g );
  r8mat_print ( n, n, r, '  Computed upper Cholesky factor R:' );

  b = r' * r;
  r8mat_print ( n, n, b, '  Product R''R:' );

  return
end

