function i4mat_rref_solve_binary_nz_test ( )

%*****************************************************************************80
%
%% I4MAT_RREF_SOLVE_BINARY_NZ_TEST tests I4MAT_RREF_SOLVE_BINARY_NZ.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    14 May 2018
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'I4MAT_RREF_SOLVE_BINARY_NZ_TEST:\n' );
  fprintf ( 1, '  I4MAT_RREF_SOLVE_BINARY_NZ seeks binary solutions of\n' );
  fprintf ( 1, '  an Integer Row-Reduced Echelon Form (IRREF) system A*x=b\n' );
  fprintf ( 1, '  which have exactly NZ nonzeros.\n' );

  m = 9;
  n = 10;

  a = [
    1, 0, 0, 0, 0, 0, 1, 0,-1, 0;
    0, 1, 0, 0, 0, 0, 0, 0, 1, 0;
    0, 0, 1, 0, 0, 0, 1, 0,-1, 0;
    0, 0, 0, 1, 0, 0, 0, 0, 1, 1;
    0, 0, 0, 0, 1, 0, 0, 0, 0, 1;
    0, 0, 0, 0, 0, 1,-1, 0, 1, 0;
    0, 0, 0, 0, 0, 0, 0, 1, 0,-1;
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0;
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ];

  i4mat_print ( m, n, a, '  The IRREF matrix A:' );

  b = [ 
    0; 1; 0; 1; 1; 1; 0; 0; 0 ];

  i4vec_print ( m, b, '  The right hand side b:' );

  nz = 4;
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Only consider binary solutions with exactly %d nonzeros.\n', nz );

  [ x_num, x ] = i4mat_rref_solve_binary_nz ( m, n, nz, a, b );

  i4mat_print ( n, x_num, x, '  Binary solution vectors x:' )

  return
end

