function r8poly_p2n_test ( )

%*****************************************************************************80
%
%% r8poly_p2n_test() tests r8poly_p2n().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    13 April 2009
%
%  Author:
%
%    John Burkardt
%
  n = 4;
  ap = r8vec_indicator1 ( n );

  x(1:n) = 2.0 * ap(1:n);
 
  fprintf ( 1, '\n' );
  fprintf ( 1, 'r8poly_p2n_test():\n' );
  fprintf ( 1, '  r8poly_p2n(): Power sum => Newton.\n' );

  r8poly_print ( ap, '  The power sum polynomial:' );
 
  an = r8poly_p2n ( n, ap, x );
 
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Newton polynomial coefficients:\n' );
  fprintf ( 1, '\n' );
  for i = 1 : n
    fprintf ( 1, '  %12f', an(i) );
  end
  fprintf ( 1, '\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Newton polynomial abscissas:\n' );
  fprintf ( 1, '\n' );
  for i = 1 : n
    fprintf ( 1, '  %12f', x(i) );
  end
  fprintf ( 1, '\n' );
 
  ap2 = r8poly_n2p ( n, an, x );
 
  r8poly_print ( ap2, '  The recovered power sum polynomial:' );

  return
end
