program main !*****************************************************************************80 ! !! test_digraph_adj_test() tests test_digraph_adj(). ! ! Licensing: ! ! This code is distributed under the MIT license. ! ! Modified: ! ! 15 April 2026 ! ! Author: ! ! John Burkardt ! implicit none call timestamp ( ) write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'test_digraph_adj_test():' write ( *, '(a)' ) ' Fortran90 version' write ( *, '(a)' ) ' Test test_digraph_adj(), which returns digraphs' write ( *, '(a)' ) ' defined by an adjacency matrix.' call digraph_adj_example_abc_test ( ) call digraph_adj_example_abcd_test ( ) call digraph_adj_example_cycler_test ( ) call digraph_adj_example_five_test ( ) call digraph_adj_example_moler_test ( ) call digraph_adj_example_sauer_test ( ) call digraph_adj_example_sixty_test ( ) ! ! Terminate. ! write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'test_digraph_adj_test():' write ( *, '(a)' ) ' Normal end of execution.' write ( *, '(a)' ) ' ' call timestamp ( ) stop 0 end subroutine digraph_adj_example_abc_test ( ) !*****************************************************************************80 ! !! digraph_adj_example_abc_test() tests digraph_adj_example_abc(). ! ! Licensing: ! ! This code is distributed under the MIT license. ! ! Modified: ! ! 11 April 2026 ! ! Author: ! ! John Burkardt ! implicit none integer, parameter :: node_num = 3 integer A(node_num,node_num) write ( *, '(a)' ) '' write ( *, '(a)' ) 'abc_adjacency_test():' write ( *, '(a)' ) ' abc_adjacency() returns the abc digraph adjacency matrix.' call digraph_adj_example_abc ( A ) call digraph_adj_print ( A, node_num, ' The abc digraph adjacency matrix' ) return end subroutine digraph_adj_example_abcd_test ( ) !*****************************************************************************80 ! !! digraph_adj_example_abcd_test() tests digraph_adj_example_abcd(). ! ! Licensing: ! ! This code is distributed under the MIT license. ! ! Modified: ! ! 11 April 2026 ! ! Author: ! ! John Burkardt ! implicit none integer, parameter :: node_num = 4 integer A(node_num,node_num) write ( *, '(a)' ) '' write ( *, '(a)' ) 'digraph_adj_example_abcd_test():' write ( *, '(a)' ) ' digraph_adj_example_abcd() returns the abcd digraph adjacency matrix.' call digraph_adj_example_abcd ( A ) call digraph_adj_print ( A, node_num, ' The abcd digraph adjacency matrix' ) return end subroutine digraph_adj_example_cycler_test ( ) !*****************************************************************************80 ! !! digraph_adj_example_cycler_test() tests digraph_adj_example_cycler(). ! ! Licensing: ! ! This code is distributed under the MIT license. ! ! Modified: ! ! 11 April 2026 ! ! Author: ! ! John Burkardt ! implicit none integer, parameter :: node_num = 9 integer A(node_num,node_num) write ( *, '(a)' ) '' write ( *, '(a)' ) 'digraph_adj_example_cycler_test():' write ( *, '(a)' ) ' digraph_adj_example_cycler() returns the cycler digraph adjacency matrix.' call digraph_adj_example_cycler ( A ) call digraph_adj_print ( A, node_num, ' The cycler digraph adjacency matrix' ) return end subroutine digraph_adj_example_five_test ( ) !*****************************************************************************80 ! !! digraph_adj_example_five_test() tests digraph_adj_example_five(). ! ! Licensing: ! ! This code is distributed under the MIT license. ! ! Modified: ! ! 11 April 2026 ! ! Author: ! ! John Burkardt ! implicit none integer, parameter :: node_num = 5 integer A(node_num,node_num) write ( *, '(a)' ) '' write ( *, '(a)' ) 'digraph_adj_example_five_test():' write ( *, '(a)' ) ' digraph_adj_example_five() returns the five digraph adjacency matrix.' call digraph_adj_example_five ( A ) call digraph_adj_print ( A, node_num, ' The five digraph adjacency matrix' ) return end subroutine digraph_adj_example_moler_test ( ) !*****************************************************************************80 ! !! digraph_adj_example_moler_test() tests digraph_adj_example_moler(). ! ! Licensing: ! ! This code is distributed under the MIT license. ! ! Modified: ! ! 11 April 2026 ! ! Author: ! ! John Burkardt ! implicit none integer, parameter :: node_num = 6 integer A(node_num,node_num) write ( *, '(a)' ) '' write ( *, '(a)' ) 'digraph_adj_example_moler_test():' write ( *, '(a)' ) ' digraph_adj_example_moler() returns the Moler digraph adjacency matrix.' call digraph_adj_example_moler ( A ) call digraph_adj_print ( A, node_num, ' The Moler digraph adjacency matrix' ) return end subroutine digraph_adj_example_sauer_test ( ) !*****************************************************************************80 ! !! digraph_adj_example_sauer_test() tests digraph_adj_example_sauer(). ! ! Licensing: ! ! This code is distributed under the MIT license. ! ! Modified: ! ! 11 April 2026 ! ! Author: ! ! John Burkardt ! implicit none integer, parameter :: node_num = 15 integer A(node_num,node_num) write ( *, '(a)' ) '' write ( *, '(a)' ) 'digraph_adj_example_sauer_test():' write ( *, '(a)' ) ' digraph_adj_example_sauer() returns the Sauer digraph adjacency matrix.' call digraph_adj_example_sauer ( A ) call digraph_adj_print ( A, node_num, ' The Sauer digraph adjacency matrix' ) return end subroutine digraph_adj_example_sixty_test ( ) !*****************************************************************************80 ! !! digraph_adj_example_sixty_test() tests digraph_adj_example_sixty(). ! ! Licensing: ! ! This code is distributed under the MIT license. ! ! Modified: ! ! 11 April 2026 ! ! Author: ! ! John Burkardt ! implicit none integer, parameter :: node_num = 12 integer A(node_num,node_num) write ( *, '(a)' ) '' write ( *, '(a)' ) 'digraph_adj_example_sixty_test():' write ( *, '(a)' ) ' digraph_adj_example_sixty() returns the Sixty digraph adjacency matrix.' call digraph_adj_example_sixty ( A ) call digraph_adj_print ( A, node_num, ' The Sixty digraph adjacency matrix' ) return end subroutine timestamp ( ) !*****************************************************************************80 ! !! timestamp() prints the current YMDHMS date as a time stamp. ! ! Example: ! ! 31 May 2001 9:45:54.872 AM ! ! Licensing: ! ! This code is distributed under the MIT license. ! ! Modified: ! ! 15 August 2021 ! ! Author: ! ! John Burkardt ! implicit none character ( len = 8 ) ampm integer d integer h integer m integer mm character ( len = 9 ), parameter, dimension(12) :: month = (/ & 'January ', 'February ', 'March ', 'April ', & 'May ', 'June ', 'July ', 'August ', & 'September', 'October ', 'November ', 'December ' /) integer n integer s integer values(8) integer y call date_and_time ( values = values ) y = values(1) m = values(2) d = values(3) h = values(5) n = values(6) s = values(7) mm = values(8) if ( h < 12 ) then ampm = 'AM' else if ( h == 12 ) then if ( n == 0 .and. s == 0 ) then ampm = 'Noon' else ampm = 'PM' end if else h = h - 12 if ( h < 12 ) then ampm = 'PM' else if ( h == 12 ) then if ( n == 0 .and. s == 0 ) then ampm = 'Midnight' else ampm = 'AM' end if end if end if write ( *, '(i2.2,1x,a,1x,i4,2x,i2,a1,i2.2,a1,i2.2,a1,i3.3,1x,a)' ) & d, trim ( month(m) ), y, h, ':', n, ':', s, '.', mm, trim ( ampm ) return end