function test_interp_fun_test07 ( )

%*****************************************************************************80
%
%% test_interp_fun_test07() uses cubic spline interpolation on all problems.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    24 August 2011
%
%  Author:
%
%    John Burkardt
%
  ibcbeg = 0;
  ibcend = 0;
  ybcbeg = 0.0;
  ybcend = 0.0;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'test_interp_fun_test07():\n' );
  fprintf ( 1, '  Cubic spline interpolation.\n' );

  prob_num = p00_prob_num ( );

  for prob = 1 : prob_num

    title = p00_title ( prob );
    [ a, b ] = p00_lim ( prob );

    ndata = 11;
    xdata = zeros ( ndata, 1 );
    ydata = zeros ( ndata, 1 );

    for i = 1 : ndata
      xdata(i) = ( ( ndata - i     ) * a   ...
                 + (         i - 1 ) * b ) ...
                 / ( ndata     - 1 );
      ydata(i) = p00_fun ( prob, xdata(i) );
    end
%
%  Set up the interpolation function.
%
    ypp = spline_cubic_set ( ndata, xdata, ydata, ibcbeg, ybcbeg, ibcend, ...
      ybcend );

    fprintf ( 1, '\n' );
    fprintf ( 1, '  Problem %d\n', prob );
    fprintf ( 1, '  %s\n', title );
    fprintf ( 1, '\n' );
    fprintf ( 1, '    X   Y\n' );
    fprintf ( 1, '\n' );
%
%  Evaluate the interpolation function.
%
    for i = 1 : ndata - 1

      jmax = 3;

      if ( i == ndata - 1 )
        jhi = jmax;
      else
        jhi = jmax - 1;
      end

      for j = 1 : jhi

        xval = ( ( jmax - j     ) * xdata(i)     ...
               + (        j - 1 ) * xdata(i+1) ) ...
               / ( jmax     - 1 );

        [ yval, ypval, yppval ] = spline_cubic_val ( ndata, xdata, ydata, ...
          ypp, xval );

        if ( j == 1 || j == 3 )
          mark = '*';
        else
          mark = ' ';
        end

        fprintf ( 1, '  %c  %14g  %14g\n', mark, xval, yval );

      end

    end

  end

  return
end
