function r8mat_is_binary_test ( )

%*****************************************************************************80
%
%% r8mat_is_binary_test() tests r8mat_is_binary().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    24 April 2018
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'r8mat_is_binary_test():\n' );
  fprintf ( 1, '  r8mat_is_binary() is TRUE if an R8MAT only contains\n' );
  fprintf ( 1, '  0 or 1 entries.\n' );

  m = 2;
  n = 3;

  x = [ ...
    0, 1, 0; ... 
    1, 0, 1 ];
  r8mat_print ( m, n, x, '  Matrix:' );
  if ( r8mat_is_binary ( m, n, x ) )
    fprintf ( 1, '  X is binary\n' );
  else
    fprintf ( 1, '  X is NOT binary.\n' );
  end

  x = [ ...
    1, 1, 1; ... 
    1, 1, 1 ];
  r8mat_print ( m, n, x, '  Matrix:' );
  if ( r8mat_is_binary ( m, n, x ) )
    fprintf ( 1, '  X is binary\n' );
  else
    fprintf ( 1, '  X is NOT binary.\n' );
  end

  x = [ ...
    0, 1, 0; ... 
    1, 2, 1 ];
  r8mat_print ( m, n, x, '  Matrix:' );
  if ( r8mat_is_binary ( m, n, x ) )
    fprintf ( 1, '  X is binary\n' );
  else
    fprintf ( 1, '  X is NOT binary.\n' );
  end

  return
end
