function hamming84_g_test ( )

%*****************************************************************************80
%
%% HAMMING84_G_TEST tests HAMMING84_G.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    03 July 2018
%
%  Author:
%
%    John Burkardt
%
  r = 3;
  n = 2^r;
  k = 2^r - r - 1;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'HAMMING84_G_TEST:\n' );
  fprintf ( 1, '  HAMMING84_G returns the Hamming G84 matrix.\n' );
  fprintf ( 1, '  Multiplying a message by G84 gives the corresponding codeword,\n' );
  fprintf ( 1, '  and includes a parity bit.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Exponent R = %d\n', r );
  fprintf ( 1, '  Block length N = 2^R-1 = %d\n', n );
  fprintf ( 1, '  Message length K = 2^R - R - 1 = %d.\n', k );

  g84 = hamming84_g ( );

  fprintf ( 1, '\n' );
  fprintf ( 1, '   I Message(I)      Codeword(I)\n' );
  fprintf ( 1, '\n' );

  i_max = 2^k - 1;

  for i = 0 : i_max
    x = ui4_to_ubvec ( i, k );
    y = g84 * x;
    y = mod ( y, 2 );
    fprintf ( 1, '  %2d: (%d %d %d %d) -->  (%d %d %d %d %d %d %d %d)\n', ...
      i, x(1:k), y(1:n) )
  end

  return
end

