function tetrahedron_ncc_rule_test03 ( )

%*****************************************************************************80
%
%% tetrahedron_ncc_rule_test03() 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_test03\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, for each\n' );
  fprintf ( 1, '  quadrature point, the barycentric coordinates\n' );
  fprintf ( 1, '  sum to 1.\n' );

  rule_num = tetrahedron_ncc_rule_num ( 'DUMMY' );

  fprintf ( 1, '\n' );
  fprintf ( 1, '      Rule   Suborder    Sum of coordinates\n' );
  fprintf ( 1, '\n' );

  for rule = 1 : rule_num

    suborder_num = tetrahedron_ncc_suborder_num ( rule );

    [ suborder_xyz, suborder_w ] = tetrahedron_ncc_subrule ( rule, suborder_num );

    fprintf ( 1, '\n' );
    fprintf ( 1, '  %8d  %8d\n', rule, suborder_num );
    for suborder = 1 : suborder_num
      xyz_sum = sum ( suborder_xyz(1:4,suborder) );
      fprintf ( 1, '                      %25e\n', xyz_sum );
    end
    
  end

  return
end
