function triangle_symq_to_ref_test ( )

%*****************************************************************************80
%
%% triangle_symq_to_ref_test() tests triangle_symq_to_ref().
%
%  Licensing:
%
%    This code is distributed under the GNU GPL license.
%
%  Modified:
%
%    28 March 2023
%
%  Author:
%
%    Original FORTRAN77 version by Hong Xiao, Zydrunas Gimbutas.
%    This version by John Burkardt.
%
%  Reference:
%
%    Hong Xiao, Zydrunas Gimbutas,
%    A numerical algorithm for the construction of efficient quadrature
%    rules in two and higher dimensions,
%    Computers and Mathematics with Applications,
%    Volume 59, 2010, pages 663-676.
%
  addpath ( '../triangle_symq_to_ref' );

  timestamp ( );
  fprintf ( 1, '\n' );
  fprintf ( 1, 'triangle_symq_to_ref_test():\n' );
  fprintf ( 1, '  MATLAB/Octave version %s\n', version );
  fprintf ( 1, '  triangle_symq_to_ref() requests that a symmetric\n' );
  fprintf ( 1, '  rule for an equilateral triangle be converted to the \n' );
  fprintf ( 1, '  reference triangle.\n' );

  for degree = 1 : 50

    [ n, w, x, y, z ] = triangle_symq_to_ref ( degree );

    fprintf ( 1, '\n' );
    fprintf ( 1, '  Exact for polynomials through total degree = %d\n', degree );
    fprintf ( 1, '  Number of nodes = %d\n', n );
    fprintf ( 1, '  I             W                      X                       Y                     Z\n' );
    for i = 1 : n
      fprintf ( 1, '%3d:  %21.16f  %21.16f  %21.16f  %21.16f\n', ...
        i, w(i), x(i), y(i), z(i) );
    end
 
  end
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'triangle_symq_to_ref_test():\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  timestamp ( );

  rmpath ( '../triangle_symq_to_ref' );

  return
end
function timestamp ( )

%*****************************************************************************80
%
%% timestamp() prints the current YMDHMS date as a timestamp.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    14 November 2022
%
%  Author:
%
%    John Burkardt
%
  t = now ( );
  c = datevec ( t );
  s = datestr ( c, 0 );
  fprintf ( 1, '%s\n', s );

  return
end
