function [ n_data, a, b, lambda, x, fx ] = beta_noncentral_cdf_values ( n_data )

%*****************************************************************************80
%
%% beta_noncentral_cdf_values() returns some values of the noncentral Beta CDF.
%
%  Discussion:
%
%    The values presented here are taken from the reference, where they
%    were given to a limited number of decimal places.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    25 January 2008
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    R Chattamvelli, R Shanmugam,
%    Algorithm AS 310:
%    Computing the Non-central Beta Distribution Function,
%    Applied Statistics,
%    Volume 46, Number 1, 1997, pages 146-156.
%
%  Input:
%
%    integer N_DATA.  The user sets N_DATA to 0 before the first call. 
%    On subsequent calls, leave N_DATA at its output value from the
%    previous 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.
%
%    real A, B, the shape parameters.
%
%    real LAMBDA, the noncentrality parameter.
%
%    real X, the argument of the function.
%
%    real FX, the value of the function.
%
  n_max = 25;

  a_vec = [ ...
        5.0, ...
        5.0, ...
        5.0, ...
       10.0, ...
       10.0, ...
       10.0, ...
       20.0, ...
       20.0, ...
       20.0, ...
       10.0, ...
       10.0, ...
       15.0, ...
       20.0, ...
       20.0, ...
       20.0, ...
       30.0, ...
       30.0, ...
       10.0, ...
       10.0, ...
       10.0, ...
       15.0, ...
       10.0, ...
       12.0, ...
       30.0, ...
       35.0 ];
  b_vec = [ ...
        5.0, ...
        5.0, ...
        5.0, ...
       10.0, ...
       10.0, ...
       10.0, ...
       20.0, ...
       20.0, ...
       20.0, ...
       20.0, ...
       10.0, ...
        5.0, ...
       10.0, ...
       30.0, ...
       50.0, ...
       20.0, ...
       40.0, ...
        5.0, ...
       10.0, ...
       30.0, ...
       20.0, ...
        5.0, ...
       17.0, ...
       30.0, ...
       30.0 ];
  fx_vec = [ ...
       0.4563021, ...
       0.1041337, ...
       0.6022353, ...
       0.9187770, ...
       0.6008106, ...
       0.0902850, ...
       0.9998655, ...
       0.9925997, ...
       0.9641112, ...
       0.9376626573, ...
       0.7306817858, ...
       0.1604256918, ...
       0.1867485313, ...
       0.6559386874, ...
       0.9796881486, ...
       0.1162386423, ...
       0.9930430054, ...
       0.0506899273, ...
       0.1030959706, ...
       0.9978417832, ...
       0.2555552369, ...
       0.0668307064, ...
       0.0113601067, ...
       0.7813366615, ...
       0.8867126477 ];
  lambda_vec = [ ...
        54.0, ...
       140.0, ...
       170.0, ...
        54.0, ...
       140.0, ...
       250.0, ...
        54.0, ...
       140.0, ...
       250.0, ...
       150.0, ...
       120.0, ...
        80.0, ...
       110.0, ...
        65.0, ...
       130.0, ...
        80.0, ...
       130.0, ...
        20.0, ...
        54.0, ...
        80.0, ...
       120.0, ...
        55.0, ...
        64.0, ...
       140.0, ...
        20.0 ];
  x_vec = [ ...
       0.8640, ...
       0.9000, ...
       0.9560, ...
       0.8686, ...
       0.9000, ...
       0.9000, ...
       0.8787, ...
       0.9000, ...
       0.9220, ...
       0.868, ...
       0.900, ...
       0.880, ...
       0.850, ...
       0.660, ...
       0.720, ...
       0.720, ...
       0.800, ...
       0.644, ...
       0.700, ...
       0.780, ...
       0.760, ...
       0.795, ...
       0.560, ...
       0.800, ...
       0.670 ];

  if ( n_data < 0 )
    n_data = 0;
  end

  n_data = n_data + 1;

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

  return
end
