function pwl_value_1d_test ( )

%*****************************************************************************80
%
%% pwl_value_1d_test() tests pwl_value_1d().
%
%  Discussion:
%
%    f(x) = x^3 - 12 x^2 + 39 x - 28 = ( x - 1 ) * ( x - 4 ) * ( x - 7 )
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified: 
%
%    01 July 2015
%
%  Author:
%
%    John Burkardt
%
  nd = 4;
  ni = 21;

  xd = [ 0.0; 2.0; 5.0; 10.0 ];
  yd = [ -28.0, +10.0, -8.0, +162.0 ];
 
  fprintf ( '\n' );
  fprintf ( 'pwl_value_1d_test():\n' );
  fprintf ( '  pwl_value_1d() evaluates a piecewise linear 1D interpolant.\n' );

  x_min = 0.0;
  x_max = 10.0;
  xi = linspace ( x_min, x_max, ni );

  yi = pwl_value_1d ( nd, xd, yd, ni, xi );

  r8vec2_print ( xi, yi, '  Table of interpolant values:' );

  return
end
