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

%*****************************************************************************80
%
%% lf_function_values() returns some values of the Laguerre function Lf(n,alpha,x).
%
%  Discussion:
%
%    In Mathematica, the function can be evaluated by:
%
%      LaguerreL[n,a,x]
%
%    The functions satisfy the following differential equation:
%
%      X * Y'' + (ALPHA+1-X) * Y' + N * Y = 0
%
%    Function values can be generated by the recursion:
%
%      Lf(0,ALPHA,X) = 1
%      Lf(1,ALPHA,X) = 1+ALPHA-X
%
%      Lf(N,ALPHA,X) = ( (2*N-1+ALPHA-X) * Lf(N-1,ALPHA,X)
%                          - (N-1+ALPHA) * Lf(N-2,ALPHA,X) ) / N
%
%    The parameter ALPHA is required to be greater than -1.
%
%    For ALPHA = 0, the generalized Laguerre function Lf(N,ALPHA,X)
%    is equal to the Laguerre polynomial L(N,X).
%
%    For ALPHA integral, the generalized Laguerre function
%    Lf(N,ALPHA,X) equals the associated Laguerre polynomial Lm(N,ALPHA,X).
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    09 March 2012
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    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 order of the function.
%
%    real A, the parameter.
%
%    real X, the point where the function is evaluated.
%
%    real FX, the value of the function.
%
  n_max = 20;

  a_vec = [ ...
     0.00E+00, ...
     0.25E+00, ...
     0.50E+00, ...
     0.75E+00, ...
     1.50E+00, ...
     2.50E+00, ...
     5.00E+00, ...
     1.20E+00, ...
     1.20E+00, ...
     1.20E+00, ...
     1.20E+00, ...
     1.20E+00, ...
     1.20E+00, ...
     5.20E+00, ...
     5.20E+00, ...
     5.20E+00, ...
     5.20E+00, ...
     5.20E+00, ...
     5.20E+00, ...
     5.20E+00 ];

  fx_vec = [ ...
      0.3726399739583333E-01, ...
      0.3494791666666667E+00, ...
      0.8710042317708333E+00, ...
      0.1672395833333333E+01, ...
      0.6657625325520833E+01, ...
      0.2395726725260417E+02, ...
      0.2031344319661458E+03, ...
      0.1284193996800000E+02, ...
      0.5359924801587302E+01, ...
      0.9204589064126984E+00, ...
     -0.1341585114857143E+01, ...
     -0.2119726307555556E+01, ...
     -0.1959193658349206E+01, ...
      0.1000000000000000E+01, ...
      0.5450000000000000E+01, ...
      0.1720125000000000E+02, ...
      0.4110393750000000E+02, ...
      0.8239745859375000E+02, ...
      0.1460179186171875E+03, ...
      0.2359204608298828E+03 ];

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

  x_vec = [ ...
     0.25E+00, ...
     0.25E+00, ...
     0.25E+00, ...
     0.25E+00, ...
     0.25E+00, ...
     0.25E+00, ...
     0.25E+00, ...
     0.00E+00, ...
     0.20E+00, ...
     0.40E+00, ...
     0.60E+00, ...
     0.80E+00, ...
     1.00E+00, ...
     0.75E+00, ...
     0.75E+00, ...
     0.75E+00, ...
     0.75E+00, ...
     0.75E+00, ...
     0.75E+00, ...
     0.75E+00 ];

  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.0;
    x = 0.0;
    fx = 0.0;
  else
    n = n_vec(n_data);
    a = a_vec(n_data);
    x = x_vec(n_data);
    fx = fx_vec(n_data);
  end

  return
end
