function i4mat_rref_solve_binary_test ( )

%*****************************************************************************80
%
%% i4mat_rref_solve_binary_test() tests i4mat_rref_solve_binary().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    29 March 2018
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'i4mat_rref_solve_binary_test():\n' );
  fprintf ( 1, '  i4mat_rref_solve_binary() seeks binary solutions of\n' );
  fprintf ( 1, '  an Integer Row-Reduced Echelon Form (IRREF) system A*x=b\n' );
  fprintf ( 1, '  when A and b contain integer values.\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:' );

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

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

  return
end

