function tetrahedron_ncc_rule_test02 ( )

%*****************************************************************************80
%
%% tetrahedron_ncc_rule_test02() tests tetrahedron_ncc_rule().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    30 January 2007
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'tetrahedron_ncc_rule_test02()\n' );
  fprintf ( 1, '  TETRAHEDRON_NCC_RULE returns the points and weights\n' );
  fprintf ( 1, '  of an NCC rule for the tetrahedron.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  In this test, we simply check that the weights\n' );
  fprintf ( 1, '  sum to 1.\n' );

  rule_num = tetrahedron_ncc_rule_num ( 'DUMMY' );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Number of available rules = %d\n', rule_num );
  fprintf ( 1, '\n' );
  fprintf ( 1, '      Rule    Sum of weights\n' );
  fprintf ( 1, '\n' );

  for rule = 1 : rule_num

    order_num = tetrahedron_ncc_order_num ( rule );

    [ xy, w ] = tetrahedron_ncc_rule ( rule, order_num );

    w_sum = sum ( w(1:order_num) );

    fprintf ( 1, '  %8d  %14f\n', rule, w_sum );
    
  end

  return
end
