function tetrahedron_ncc_rule_test06 ( )

%*****************************************************************************80
%
%% tetrahedron_ncc_rule_test06() tests tetrahedron_ncc_rule().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    30 January 2007
%
%  Author:
%
%    John Burkardt
%
  dim_num = 3;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'tetrahedron_ncc_rule_test06()\n' );
  fprintf ( 1, '  TETRAHEDRON_NCC_RULE returns the points and weights\n' );
  fprintf ( 1, '  of an NCC rule for the tetrahedron.\n' );

  rule = 4;

  fprintf ( 1, '\n' );
  fprintf ( 1, '  In this test, we simply print rule %d\n', rule );

  suborder_num = tetrahedron_ncc_suborder_num ( rule );

  suborder = tetrahedron_ncc_suborder ( rule, suborder_num );

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

  fprintf ( 1, '\n' );
  fprintf ( 1, '  The compressed rule:\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Number of suborders = %d\n', suborder_num );
  fprintf ( 1, '\n' );
  fprintf ( 1, '     S   Sub     Weight     Xsi1      Xsi2      Xsi3      Xsi4\n' );
  fprintf ( 1, '\n' );
  
  for s = 1 : suborder_num
    fprintf ( 1, '  %4d  %4d  %8f  %8f  %8f  %8f  %8f\n', ...
      s, suborder(s), suborder_w(s), suborder_xyz(1:4,s) );
  end

  order_num = tetrahedron_ncc_order_num ( rule );

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

  fprintf ( 1, '\n' );
  fprintf ( 1, '  The full rule:\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Order = %4d\n', order_num );
  fprintf ( 1, '\n' );
  fprintf ( 1, '     O    Weight      X         Y         Z\n' );
  fprintf ( 1, '\n' );
  
  for o = 1 : order_num
    fprintf ( 1, '  %4d  %8f  %8f  %8f  %8f\n', o, w(o), xyz(1:dim_num,o) );
  end

  suborder = [];
  suborder_w = [];
  suborder_xyz = [];
  w = [];
  xyz = [];

  return
end

