function r8mat_rref_solve_binary_test ( )

%*****************************************************************************80
%
%% r8mat_rref_solve_binary_test() tests r8mat_rref_solve_binary().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    29 March 2018
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'r8mat_rref_solve_binary_test:\n' );
  fprintf ( 1, '  r8mat_rref_solve_binary() seeks binary solutions of\n' );
  fprintf ( 1, '  a Row-Reduced Echelon Form linear system A*x=b.\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 ];

  r8mat_print ( m, n, a, '  The RREF matrix A:' );

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

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

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

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

  return
end

