function bernstein_matrix_inverse_test ( )

%*****************************************************************************80
%
%% bernstein_matrix_inverse_test() tests bernstein_matrix_inverse().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    10 July 2011
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'bernstein_matrix_inverse_test():\n' );
  fprintf ( 1, '  bernstein_matrix_inverse() computes the inverse of the\n' );
  fprintf ( 1, '  Bernstein matrix A.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '    N     |A|       |inv(A)| |I-A*inv(A)|\n' );
  fprintf ( 1, '\n' );

  for n = 5 : 15

    a = bernstein_matrix ( n );
    a_norm_frobenius = r8mat_norm_fro ( n, n, a );

    b = bernstein_matrix_inverse ( n );
    b_norm_frobenius = r8mat_norm_fro ( n, n, b );

    c = a * b;
    error_norm_frobenius = r8mat_is_identity ( n, c );

    fprintf ( 1, '  %4d  %14g  %14g  %14g\n', ...
      n, a_norm_frobenius, b_norm_frobenius, error_norm_frobenius );

  end

  return
end

