function bernstein_to_legendre_test ( )

%*****************************************************************************80
%
%% BERNSTEIN_TO_LEGENDRE_TEST tests BERNSTEIN_TO_LEGENDRE.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    09 March 2016
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'BERNSTEIN_TO_LEGENDRE_TEST:\n' );
  fprintf ( 1, '  BERNSTEIN_TO_LEGENDRE returns the matrix A which maps\n' );
  fprintf ( 1, '  polynomial coefficients from Bernstein to Legendre form.\n' );

  n = 5;
  a = bernstein_to_legendre ( n );
  r8mat_print ( n + 1, n + 1, a, '  A = bernstein_to_legendre(5):' );

  b = legendre_to_bernstein ( n );
  r8mat_print ( n + 1, n + 1, b, '  B = legendre_to_bernstein(5):' );

  c = a * b;
  e = r8mat_is_identity ( n + 1, c );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  ||A*B-I|| = %g\n', e );

  return
end
