function matrix_is_adjacency_test ( )

%*****************************************************************************80
%
%% matrix_is_adjacency_test() tests matrix_is_adjacency().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    11 March 2023
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'matrix_is_adjacency_test( ):\n' );
  fprintf ( 1, '  matrix_is_adjacency() requires that a matrix A be:\n' );
  fprintf ( 1, '  * square\n' );
  fprintf ( 1, '  * symmetric\n' );
  fprintf ( 1, '  * zero on the diagonal\n' );
  fprintf ( 1, '  * only have 0 or 1 as values.\n' );

  A = [ ...
    0, 0, 1; ...
    0, 0, 1; ...
    1, 1, 0; ...
    0, 0, 1 ];

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Matrix A:\n' );
  disp ( A );
  value = matrix_is_adjacency ( A );
  fprintf ( 1, '  matrix_is_adjacency(A) = %s\n', mat2str ( value ) );

  B = [ ...
    0, 0, 1; ...
    1, 0, 1; ...
    1, 1, 0];

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Matrix B:\n' );
  disp ( B );
  value = matrix_is_adjacency ( B );
  fprintf ( 1, '  matrix_is_adjacency(B) = %s\n', mat2str ( value ) );

  C = [ ...
    1, 0, 1; ...
    0, 1, 1; ...
    1, 1, 1];

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Matrix C:\n' );
  disp ( C );
  value = matrix_is_adjacency ( C );
  fprintf ( 1, '  matrix_is_adjacency(C) = %s\n', mat2str ( value ) );

  D = [ ...
    0, 1, 2; ...
    1, 0, 1; ...
    2, 1, 0];

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Matrix D:\n' );
  disp ( D );
  value = matrix_is_adjacency ( D );
  fprintf ( 1, '  matrix_is_adjacency(D) = %s\n', mat2str ( value ) );

  E = [ ...
    0, 1, 1; ...
    1, 0, 1; ...
    1, 1, 0];

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Matrix E:\n' );
  disp ( E );
  value = matrix_is_adjacency ( E );
  fprintf ( 1, '  matrix_is_adjacency(E) = %s\n', mat2str ( value ) );

  return
end

