function president_matrix_test ( )

%*****************************************************************************80
%
%% president_matrix_test() tests president_matrix().
%
%  Licensing:
%
%    This code is distributed under the MIT license. 
%
%  Modified:
%
%    05 May 2026
%
%  Author:
%
%    John Burkardt
%
  addpath ( '../president_matrix' );

  lastname = { ...
    "Washington", "Adams" ,    "Jefferson", "Madison",    "Monroe", ...
    "Adams",      "Jackson",   "vanBuren",  "Harrison",   "Tyler", ...
    "Polk",       "Taylor",    "Fillmore",  "Pierce",     "Buchanan", ...
    "Lincoln",    "Johnson",   "Grant",     "Hayes",      "Garfield", ...
    "Arthur",     "Cleveland", "Harrison",  "Cleveland",  "McKinley", ...
    "Roosevelt",  "Taft",      "Wilson",    "Harding",    "Coolidge", ...
    "Hoover",     "Roosevelt", "Truman",    "Eisenhower", "Kennedy",  ...
    "Johnson",    "Nixon",     "Ford",      "Carter",     "Reagan",  ...
    "Bush",       "Clinton",   "Bush",      "Obama",      "Trump", ...
    "Biden",      "Trump" };

  timestamp ( );
  fprintf ( 1, '\n' );
  fprintf ( 1, 'president_matrix_test():\n' );
  fprintf ( 1, '  MATLAB/Octave version %s\n', version ( ) );
  fprintf ( 1, '  Test president_matrix().\n' );
%
%  Evaluate the presidential lifespan adjacency matrix.
%
  A = president_matrix ( );
%
%  Use spy to draw an image of the matrix.
%
  spy ( A );
  grid ( 'on' );
  yticks ( 1:47 );
  set ( gca, 'yticklabel', lastname );
  title ( 'Presidential Lifespan Overlaps' );

  filename = 'president_matrix_test.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'president_matrix_test():\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  timestamp ( );

  rmpath ( '../president_matrix' );

  return
end
function timestamp ( )

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

  return
end

