function square_minimal_rule_print_test ( degree )

%*****************************************************************************80
%
%% square_minimal_rule_print_test() tests square_minimal_rule_print().
%
%  Licensing:
%
%    This code is distributed under the GNU GPL license.
%
%  Modified:
%
%    19 February 2018
%
%  Author:
%
%    John Burkardt.
%
%  Reference:
%
%    Mattia Festa, Alvise Sommariva,
%    Computing almost minimal formulas on the square,
%    Journal of Computational and Applied Mathematics,
%    Volume 17, Number 236, November 2012, pages 4296-4302.
%
%  Input:
%
%    integer DEGREE, the desired total polynomial degree exactness
%    of the quadrature rule.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'square_minimal_rule_print_test():\n' );
  fprintf ( 1, '  square_minimal_rule_print() prints a quadrature rule\n' );
  fprintf ( 1, '  for the symmetric unit square.\n' );
  fprintf ( 1, '  Minimal quadrature rule for a square.\n' );
  fprintf ( 1, '  Polynomial exactness degree DEGREE = %d\n', degree );
%
%  Retrieve and print a symmetric quadrature rule.
%
  xyw = square_minimal_rule ( degree );

  x = xyw(:,1);
  y = xyw(:,2);
  w = xyw(:,3);

  order = square_minimal_rule_order ( degree );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Number of nodes N = %d\n', order );

  fprintf ( 1, '\n' );
  fprintf ( 1, '     J          X               Y               W\n' );
  fprintf ( 1, '\n' );
  for j = 1 : order
    fprintf ( 1, '  %4d  %14.6g  %14.6g  %14.6g\n', j, x(j), y(j), w(j) );
  end

  d = sum ( w(1:order) );

  fprintf ( 1, '\n' );
  fprintf ( 1, '   Sum  %14.6g\n', d );
  area = squaresym_area ( );
  fprintf ( 1, '  Area  %14.6g\n', area );

  return
end
