function bernstein_to_power_test ( )

%*****************************************************************************80
%
%% bernstein_to_power_test() tests bernstein_to_power().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    15 March 2016
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'bernstein_to_power_test():\n' );
  fprintf ( 1, '  bernstein_to_power() returns the matrix A which maps\n' );
  fprintf ( 1, '  polynomial coefficients from Bernstein to Power form.\n' );

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

  b = power_to_bernstein ( n );
  r8mat_print ( n + 1, n + 1, b, '  B = power_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
