function digraph_adj_test ( )

%*****************************************************************************80
%
%% digraph_adj_test() tests digraph_adj().
%
%  Licensing:
%
%    This code is distributed under the MIT license. 
%
%  Modified:
%
%    12 February 2025
%
%  Author:
%
%    John Burkardt
%
  addpath ( '../digraph_adj' );

  timestamp ( );
  fprintf ( 1, '\n' );
  fprintf ( 1, 'digraph_adj_test():\n' );
  fprintf ( 1, '  MATLAB/Octave version %s\n', version ( ) );
  fprintf ( 1, '  Test digraph_adj().\n' );

  abc_adjacency_test ( );
  abcd_adjacency_test ( );
  five_adjacency_test ( );
  adjacency_to_google_test ( );
  adjacency_to_transition_test ( );
  moler_adjacency_test ( );
  sauer_adjacency_test ( );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'digraph_adj_test():\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  timestamp ( );

  rmpath ( '../digraph_adj' );

  return
end
function abc_adjacency_test ( )

%*****************************************************************************80
%
%% abc_adjacency_test() tests abc_adjacency().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    12 September 2024
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'abc_adjacency_test():\n' );
  fprintf ( 1, '  Test abc_adjacency()\n' );

  A = abc_adjacency ( );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  "abc" adjacency matrix A:\n' );
  disp ( A );

  return
end
function abcd_adjacency_test ( )

%*****************************************************************************80
%
%% abcd_adjacency_test() tests abcd_adjacency().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    12 September 2024
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'abcd_adjacency_test():\n' );
  fprintf ( 1, '  Test abcd_adjacency()\n' );

  A = abcd_adjacency ( );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  "abcd" adjacency matrix A:\n' );
  disp ( A );

  return
end
function five_adjacency_test ( )

%*****************************************************************************80
%
%% five_adjacency_test() tests five_adjacency().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    12 September 2024
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'five_adjacency_test():\n' );
  fprintf ( 1, '  Test five_adjacency()\n' );

  A = five_adjacency ( );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  "five" adjacency matrix A:\n' );
  disp ( A );

  return
end
function adjacency_to_google_test ( )

%*****************************************************************************80
%
%% adjacency_to_google_test() tests adjacency_to_google().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    12 September 2024
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' )
  fprintf ( 1, 'adjacency_to_google_test():\n' )
  fprintf ( 1, '  Test adjacency_to_google()\n' )

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

  fprintf ( 1, '\n' );
  fprintf ( 1, '  adjacency matrix A:\n' );
  disp ( A );

  G = adjacency_to_google ( A );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Google transition matrix G:\n' );
  disp ( G );

  return
end
function adjacency_to_transition_test ( )

%*****************************************************************************80
%
%% adjacency_to_transition_test() tests adjacency_to_transition().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    12 September 2024
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'adjacency_to_transition_test():\n' );
  fprintf ( 1, '  Test adjacency_to_transition()\n' );

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

  fprintf ( 1, '\n' );
  fprintf ( 1, '  adjacency matrix A:\n' );
  disp ( A );

  T = adjacency_to_transition ( A );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Transition matrix T:\n' );
  disp ( T );

  return
end
function moler_adjacency_test ( )

%*****************************************************************************80
%
%% moler_adjacency_test() tests moler_adjacency().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    12 September 2024
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'moler_adjacency_test():\n' );
  fprintf ( 1, '  Test moler_adjacency()\n' );

  A = moler_adjacency ( );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Moler adjacency matrix A:\n' );
  disp ( A );

  return
end
function sauer_adjacency_test ( )

%*****************************************************************************80
%
%% sauer_adjacency_test() tests sauer_adjacency().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    12 September 2024
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'sauer_adjacency_test()\n:' );
  fprintf ( 1, '  Test sauer_adjacency()\n' );

  A = sauer_adjacency ( );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Sauer adjacency matrix A:\n' );
  disp ( A );

  return
end
function timestamp ( )

%*****************************************************************************80
%
%% timestamp() prints the YMDHMS date as a timestamp.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    14 November 2022
%
%  Author:
%
%    John Burkardt
%
  t = now ( );
  c = datevec ( t );
  s = datestr ( c, 0 );
  fprintf ( 1, '%s\n', s );

  return
end

