function [ n_data, n, a, b, x, fx ] = jacobi_poly_values ( n_data )

%*****************************************************************************80
%
%% JACOBI_POLY_VALUES returns some values of the Jacobi polynomial.
%
%  Discussion:
%
%    In Mathematica, the function can be evaluated by:
%
%      JacobiP[ n, a, b, x ]
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    19 April 2012
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    Milton Abramowitz and Irene Stegun,
%    Handbook of Mathematical Functions,
%    US Department of Commerce, 1964.
%
%    Stephen Wolfram,
%    The Mathematica Book,
%    Fourth Edition,
%    Wolfram Media / Cambridge University Press, 1999.
%
%  Input:
%
%    integer N_DATA.  The user sets N_DATA to 0 before the first call.
%
%  Output:
%
%    integer N_DATA.  On each call, the routine increments N_DATA by 1, and
%    returns the corresponding data; when there is no more data, the
%    output value of N_DATA will be 0 again.
%
%    integer N, the degree of the polynomial.
%
%    real A, B, parameters of the function.
%
%    real X, the argument of the function.
%
%    real FX, the value of the function.
%
  n_max = 26;

  a_vec = [ ...
     0.0, 0.0, 0.0, 0.0, ...
     0.0, 0.0, 1.0, 2.0, ...
     3.0, 4.0, 5.0, 0.0, ...
     0.0, 0.0, 0.0, 0.0, ...
     0.0, 0.0, 0.0, 0.0, ...
     0.0, 0.0, 0.0, 0.0, ...
     0.0, 0.0 ];

  b_vec = [ ...
    1.0, 1.0, 1.0, 1.0, ...
    1.0, 1.0, 1.0, 1.0, ...
    1.0, 1.0, 1.0, 2.0, ...
    3.0, 4.0, 5.0, 1.0, ...
    1.0, 1.0, 1.0, 1.0, ...
    1.0, 1.0, 1.0, 1.0, ...
    1.0, 1.0 ];

  fx_vec = [ ...
      1.000000000000000, ...
      0.2500000000000000, ...
     -0.3750000000000000, ...
     -0.4843750000000000, ...
     -0.1328125000000000, ...
      0.2753906250000000, ...
     -0.1640625000000000, ...
     -1.174804687500000, ...
     -2.361328125000000, ...
     -2.616210937500000, ...
      0.1171875000000000, ...
      0.4218750000000000, ...
      0.5048828125000000, ...
      0.5097656250000000, ...
      0.4306640625000000, ...
     -6.000000000000000, ...
      0.03862000000000000, ...
      0.8118400000000000, ...
      0.03666000000000000, ...
     -0.4851200000000000, ...
     -0.3125000000000000, ...
      0.1891200000000000, ...
      0.4023400000000000, ...
      0.01216000000000000, ...
     -0.4396200000000000, ...
      1.000000000000000 ];

  n_vec = [ ...
     0, 1, 2, 3, ...
     4, 5, 5, 5, ...
     5, 5, 5, 5, ...
     5, 5, 5, 5, ...
     5, 5, 5, 5, ...
     5, 5, 5, 5, ...
     5, 5 ]; 

  x_vec = [ ...
      0.5, ...
      0.5, ...
      0.5, ...
      0.5, ...
      0.5, ...
      0.5, ...
      0.5, ...
      0.5, ...
      0.5, ...
      0.5, ...
      0.5, ...
      0.5, ...
      0.5, ...
      0.5, ...
      0.5, ...
     -1.0, ...
     -0.8, ...
     -0.6, ...
     -0.4, ...
     -0.2, ...
      0.0, ...
      0.2, ...
      0.4, ...
      0.6, ...
      0.8, ...
      1.0 ];

  if ( n_data < 0 )
    n_data = 0;
  end

  n_data = n_data + 1;

  if ( n_max < n_data )
    n_data = 0;
    n = 0;
    a = 0;
    b = 0;
    x = 0.0;
    fx = 0.0;
  else
    n = n_vec(n_data);
    a = a_vec(n_data);
    b = b_vec(n_data);
    x = x_vec(n_data);
    fx = fx_vec(n_data);
  end

  return
end
