function [ n, x, y, z, w ] = hexahedron_jaskowiec_rule ( p )

%*****************************************************************************80
%
%% hexahedron_jaskowiec_rule() returns a hexahedron quadrature rule of given precision.
%
%  Discussion:
%
%    The unit hexahedron H is bounded by the vertices
%    (0,0,0), (1,0,0), (1,1,0), (0,1,0), (0,0,1), (1,0,1), (1,1,1), (0,1,1).
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    17 July 2023
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    Jan Jaskowiec, Natarajan Sukumar,
%    High order symmetric cubature rules for tetrahedra and prisms,
%    International Journal of Numerical Methods in Engineering,
%    Volume 122, Number 1, pages 148-171, 24 August 2020.
%
%  Input:
%
%    integer p: the precision, 0 <= p <= 21.
%
%  Output:
%
%    integer n: the order of the rule.
%
%    real x(n), y(n), z(n): the coordinates of quadrature points.
%
%    real w(n): the quadrature weights.
%
  if ( p < 0 ) 
    error ( 'hexahedron_jaskowiec_rule(): Input p < 0.\n' );
  end

  if ( 21 < p )
    error ( 'hexahedron_jaskowiec_rule(): Input 21 < p.\n' );
  end

  n = rule_order ( p );

  if ( p <= 1 )
    [ x, y, z, w ] = rule01 ( );
  elseif ( p <= 3 )
    [ x, y, z, w ] = rule03 ( );
  elseif ( p <= 5 )
    [ x, y, z, w ] = rule05 ( );
  elseif ( p <= 7 )
    [ x, y, z, w ] = rule07 ( );
  elseif ( p <= 9 )
    [ x, y, z, w ] = rule09 ( );
  elseif ( p <= 11 )
    [ x, y, z, w ] = rule11 ( );
  elseif ( p <= 13 )
    [ x, y, z, w ] = rule13 ( );
  elseif ( p <= 15 )
    [ x, y, z, w ] = rule15 ( );
  elseif ( p <= 17 )
    [ x, y, z, w ] = rule17 ( );
  elseif ( p <= 19 )
    [ x, y, z, w ] = rule19 ( );
  elseif ( p <= 21 )
    [ x, y, z, w ] = rule21 ( );
  end

  return
end

