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

%*****************************************************************************80
%
%% triangle_symq_rule() returns the requested quadrature rule.
%
%  Licensing:
%
%    This code is distributed under the GNU GPL license.
%
%  Modified:
%
%    10 June 2023
%
%  Author:
%
%    Original FORTRAN77 version by Hong Xiao, Zydrunas Gimbutas.
%    This version by John Burkardt.
%
%  Reference:
%
%    Hong Xiao, Zydrunas Gimbutas,
%    A numerical algorithm for the construction of efficient quadrature
%    rules in two and higher dimensions,
%    Computers and Mathematics with Applications,
%    Volume 59, 2010, pages 663-676.
%
%  Input:
%
%    integer p: the precision of the quadrature.  0 <= p <= 50.
%
%  Output:
%
%    integer n: the number of nodes.
%
%    real a(n), b(n), c(n): the barycentric coordinates of the nodes.
%
%    real w(n): the weights.
%
  n = rule_order ( p );
%
%  Copy the arrays defining the compressed rule.
%
  if ( p == 0 )
    [ a, b, c, w ] = rule00 ( );
  elseif ( p == 1 )
    [ a, b, c, w ] = rule01 ( );
  elseif ( p == 2 )
    [ a, b, c, w ] = rule02 ( );
  elseif ( p == 3 )
    [ a, b, c, w ] = rule03 ( );
  elseif ( p == 4 )
    [ a, b, c, w ] = rule04 ( );
  elseif ( p == 5 )
    [ a, b, c, w ] = rule05 ( );
  elseif ( p == 6 )
    [ a, b, c, w ] = rule06 ( );
  elseif ( p == 7 )
    [ a, b, c, w ] = rule07 ( );
  elseif ( p == 8 )
    [ a, b, c, w ] = rule08 ( );
  elseif ( p == 9 )
    [ a, b, c, w ] = rule09 ( );
  elseif ( p == 10 )
    [ a, b, c, w ] = rule10 ( );
  elseif ( p == 11 )
    [ a, b, c, w ] = rule11 ( );
  elseif ( p == 12 )
    [ a, b, c, w ] = rule12 ( );
  elseif ( p == 13 )
    [ a, b, c, w ] = rule13 ( );
  elseif ( p == 14 )
    [ a, b, c, w ] = rule14 ( );
  elseif ( p == 15 )
    [ a, b, c, w ] = rule15 ( );
  elseif ( p == 16 )
    [ a, b, c, w ] = rule16 ( );
  elseif ( p == 17 )
    [ a, b, c, w ] = rule17 ( );
  elseif ( p == 18 )
    [ a, b, c, w ] = rule18 ( );
  elseif ( p == 19 )
    [ a, b, c, w ] = rule19 ( );
  elseif ( p == 20 )
    [ a, b, c, w ] = rule20 ( );
  elseif ( p == 21 )
    [ a, b, c, w ] = rule21 ( );
  elseif ( p == 22 )
    [ a, b, c, w ] = rule22 ( );
  elseif ( p == 23 )
    [ a, b, c, w ] = rule23 ( );
  elseif ( p == 24 )
    [ a, b, c, w ] = rule24 ( );
  elseif ( p == 25 )
    [ a, b, c, w ] = rule25 ( );
  elseif ( p == 26 )
    [ a, b, c, w ] = rule26 ( );
  elseif ( p == 27 )
    [ a, b, c, w ] = rule27 ( );
  elseif ( p == 28 )
    [ a, b, c, w ] = rule28 ( );
  elseif ( p == 29 )
    [ a, b, c, w ] = rule29 ( );
  elseif ( p == 30 )
    [ a, b, c, w ] = rule30 ( );
  elseif ( p == 31 )
    [ a, b, c, w ] = rule31 ( );
  elseif ( p == 32 )
    [ a, b, c, w ] = rule32 ( );
  elseif ( p == 33 )
    [ a, b, c, w ] = rule33 ( );
  elseif ( p == 34 )
    [ a, b, c, w ] = rule34 ( );
  elseif ( p == 35 )
    [ a, b, c, w ] = rule35 ( );
  elseif ( p == 36 )
    [ a, b, c, w ] = rule36 ( );
  elseif ( p == 37 )
    [ a, b, c, w ] = rule37 ( );
  elseif ( p == 38 )
    [ a, b, c, w ] = rule38 ( );
  elseif ( p == 39 )
    [ a, b, c, w ] = rule39 ( );
  elseif ( p == 40 )
    [ a, b, c, w ] = rule40 ( );
  elseif ( p == 41 )
    [ a, b, c, w ] = rule41 ( );
  elseif ( p == 42 )
    [ a, b, c, w ] = rule42 ( );
  elseif ( p == 43 )
    [ a, b, c, w ] = rule43 ( );
  elseif ( p == 44 )
    [ a, b, c, w ] = rule44 ( );
  elseif ( p == 45 )
    [ a, b, c, w ] = rule45 ( );
  elseif ( p == 46 )
    [ a, b, c, w ] = rule46 ( );
  elseif ( p == 47 )
    [ a, b, c, w ] = rule47 ( );
  elseif ( p == 48 )
    [ a, b, c, w ] = rule48 ( );
  elseif ( p == 49 )
    [ a, b, c, w ] = rule49 ( );
  elseif ( p == 50 )
    [ a, b, c, w ] = rule50 ( );
  else
    fprintf ( 1, '\n' );
    fprintf ( 1, 'triangle_symq_rule(): Fatal error!\n' );
    fprintf ( 1, '  Illegal input value of p.\n' );
    fprintf ( 1, '  0 <= p <= 50 required.\n' );
    error ( 'triangle_symq_rule(): Fatal error!' );
  end

  return
end
