function subset_gray_rank_test ( )

%*****************************************************************************80
%
%% subset_gray_rank_test() tests subset_gray_rank().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    13 April 2009
%
%  Author:
%
%    John Burkardt
%
  n = 5;
  a = [ 1, 0, 1, 1, 0 ];

  fprintf ( 1, '\n' );
  fprintf ( 1, 'subset_gray_rank_test():\n' );
  fprintf ( 1, '  subset_gray_rank() returns rank of a subset of an N set\n' );
  fprintf ( 1, '  using the Gray code ordering.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  For N = %d\n', n );
  fprintf ( 1, '  the subset is:\n' );
  for i = 1 : n
    fprintf ( 1, '  %4d', a(i) );
  end
  fprintf ( 1, '\n' );
 
  rank = subset_gray_rank ( n, a );
 
  fprintf ( 1, '\n' );
  fprintf ( 1, '  The rank is %d\n', rank );

  return
end
