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

%*****************************************************************************80
%
%% prism_jaskowiec_rule() returns a prism quadrature rule of given precision.
%
%  Discussion:
%
%    A unit triangular prism has a triangular base in the (x,y) plane,
%    projected vertically one unit in the z direction.  
%
%    The vertices are 
%      (1,0,0), (0,1,0), (0,0,0), 
%      (1,0,1), (0,1,1), (0,0,1), 
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    17 May 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 <= 20.
%
%  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 ( 'prism_jaskowiec_rule(): Input p < 0.\n' );
  end

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

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

  return
end

