function toeplitz_cholesky_upper_test ( )

%*****************************************************************************80
%
%% toeplitz_cholesky_upper_test() tests toeplitz_cholesky_upper().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    27 January 2017
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'toeplitz_cholesky_upper_test():\n' );
  fprintf ( 1, '  toeplitz_cholesky_upper() computes the upper Cholesky\n' );
  fprintf ( 1, '  factorization of a positive semi-definite Toeplitz matrix.\n' );
  fprintf ( 1, '  The matrix is supplied as an NxN array.\n' );

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

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

  r = toeplitz_cholesky_upper ( n, a );
  r8mat_print ( n, n, r, '  Computed upper Cholesky factor R:' );

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

  return
end

