function condition_test ( phi, r0 )

%*****************************************************************************80
%
%% CONDITION_TEST looks at the condition of the radial basis interpolation matrix.
%
%  Discussion:
%
%    Given a set of data FD = F(XD), the RBF weights can be found by
%      WD = A \ FD
%    after which the RBF interpolant can be evaluated at any point XI by
%      FI(XI) = WD' * PHI(XD-XI)
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    25 February 2015
%
%  Author:
%
%    John Burkardt
%
  warning ( 'off', 'all' );
  m = 1;

  n = 2;
  r8_lo = 0.0;
  r8_hi = 1.0;

  for log2_n = 1 : 6
    x = r8vec_linspace ( n, r8_lo, r8_hi );
    a = rbf_matrix ( m, n, x, r0, phi );
    c1 = cond ( a, 1 );
    x = r8vec_chebyspace ( n, r8_lo, r8_hi );
    a = rbf_matrix ( m, n, x, r0, phi );
    c2 = cond ( a, 1 );
    seed = 123456789;
    [ x, seed ] = r8vec_uniform_ab ( n, r8_lo, r8_hi, seed );
    a = rbf_matrix ( m, n, x, r0, phi );
    c3 = cond ( a, 1 );
    fprintf ( 1, '  %4d  %12g  %12g  %12g\n', n, c1, c2, c3 );
    n = n * 2;
  end

  return
end
