function [ n, a, b, c, d, w ] = tetrahedron_jaskowiec_rule ( p )

%*****************************************************************************80
%
%% tetrahedron_jaskowiec_rule() returns a tetrahedron quadrature rule of given precision.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    06 May 2023
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    Jan Jaskowiec, Natarajan Sukumar,
%    High order symmetric cubature rules for tetrahedra and pyramids,
%    International Journal of Numerical Methods in Engineering,
%    Volume 122, Number 1, pages 148-171, 24 August 2020.
%
%  Input:
%
%    integer p: the precision, 0 <= p <= 20.
%
%  Output:
%
%    integer n: the order of the rule.
%
%    real a(n), b(n), c(n), d(n): the barycentric coordinates of quadrature points.
%
%    real w(n): the quadrature weights.
%
  if ( p < 0 ) 
    error ( 'tetrahedron_jaskowiec_rule(): Input p < 0.\n' );
  end

  if ( 20 < p )
    error ( 'tetrahedron_jaskowiec_rule(): Input 20 < p.\n' );
  end

  n = rule_order ( p );
  if ( p == 0 )
    [ a, b, c, d, w ] = rule00 ( );
  elseif ( p == 1 )
    [ a, b, c, d, w ] = rule01 ( );
  elseif ( p == 2 )
    [ a, b, c, d, w ] = rule02 ( );
  elseif ( p == 3 )
    [ a, b, c, d, w ] = rule03 ( );
  elseif ( p == 4 )
    [ a, b, c, d, w ] = rule04 ( );
  elseif ( p == 5 )
    [ a, b, c, d, w ] = rule05 ( );
  elseif ( p == 6 )
    [ a, b, c, d, w ] = rule06 ( );
  elseif ( p == 7 )
    [ a, b, c, d, w ] = rule07 ( );
  elseif ( p == 8 )
    [ a, b, c, d, w ] = rule08 ( );
  elseif ( p == 9 )
    [ a, b, c, d, w ] = rule09 ( );
  elseif ( p == 10 )
    [ a, b, c, d, w ] = rule10 ( );
  elseif ( p == 11 )
    [ a, b, c, d, w ] = rule11 ( );
  elseif ( p == 12 )
    [ a, b, c, d, w ] = rule12 ( );
  elseif ( p == 13 )
    [ a, b, c, d, w ] = rule13 ( );
  elseif ( p == 14 )
    [ a, b, c, d, w ] = rule14 ( );
  elseif ( p == 15 )
    [ a, b, c, d, w ] = rule15 ( );
  elseif ( p == 16 )
    [ a, b, c, d, w ] = rule16 ( );
  elseif ( p == 17 )
    [ a, b, c, d, w ] = rule17 ( );
  elseif ( p == 18 )
    [ a, b, c, d, w ] = rule18 ( );
  elseif ( p == 19 )
    [ a, b, c, d, w ] = rule19 ( );
  elseif ( p == 20 )
    [ a, b, c, d, w ] = rule20 ( );
  end

  return
end

