function gegenbauer_polynomial_value_test ( )

%*****************************************************************************80
%
%% gegenbauer_polynomial_value_test() tests gegenbauer_polynomial_value().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    23 November 2015
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'gegenbauer_polynomial_value_test():\n' );
  fprintf ( 1, '  gegenbauer_polynomial_value() evaluates the Gegenbauer polynomial.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '       M     ALPHA         X           GPV    GEGENBAUER\n' );
  fprintf ( 1, '\n' );

  n_data = 0;

  while ( true )

    [ n_data, m, alpha, xscalar, fx ] = gegenbauer_polynomial_values ( n_data );

    if ( n_data == 0 )
      break
    end
%
%  Since GEGENBAUER_POLYNOMIAL_VALUE expects a vector input X, we have to
%  do a little "rewrapping" of the input.
%
    n = 1;
    x(1) = xscalar;
    c = gegenbauer_polynomial_value ( m, n, alpha, x );
    fprintf ( 1, '  %6d  %8.2f  %8.2f  %12f  %12f\n', m, alpha, x(1), fx, c(m+1,1) );

  end

  return
end
