47 integer ( kind = 4 ) adj_num
48 integer ( kind = 4 ) node_num
50 integer ( kind = 4 ) adj(adj_num)
52 integer ( kind = 4 ) adj_row(node_num+1)
53 integer ( kind = 4 ) band_hi
54 integer ( kind = 4 ) band_lo
55 integer ( kind = 4 ) col
56 integer ( kind = 4 ) i
57 integer ( kind = 4 ) j
64 do j = adj_row(i), adj_row(i+1) - 1
66 band_lo = max( band_lo, i - col )
67 band_hi = max( band_hi, col - i )
113 integer ( kind = 4 ) adj_num
114 integer ( kind = 4 ) node_num
116 integer ( kind = 4 ) adj(adj_num)
118 integer ( kind = 4 ) adj_row(node_num+1)
119 integer ( kind = 4 ) i
120 integer ( kind = 4 ) j
121 integer ( kind = 4 ) k
122 integer ( kind = 4 ) khi
123 integer ( kind = 4 ) klo
134 if ( node_num < i )
then
137 else if ( i < 1 )
then
140 else if ( node_num < j )
then
143 else if ( j < 1 )
then
156 if ( adj(k) == j )
then
204 integer ( kind = 4 ) adj_max
205 integer ( kind = 4 ) node_num
207 integer ( kind = 4 ) adj(adj_max)
208 integer ( kind = 4 ) adj_num
209 integer ( kind = 4 ) adj_row(node_num+1)
210 integer ( kind = 4 ) i
211 integer ( kind = 4 ) j
212 integer ( kind = 4 ) j_spot
213 integer ( kind = 4 ) k
218 if ( adj_max < adj_num + 1 )
then
219 write ( *,
'(a)' )
' '
220 write ( *,
'(a)' )
'ADJ_INSERT_IJ - Fatal error!'
221 write ( *,
'(a)' )
' All available storage has been used.'
222 write ( *,
'(a)' )
' No more information can be stored!'
223 write ( *,
'(a)' )
' This error occurred for '
224 write ( *,
'(a,i8)' )
' Row I = ', i
225 write ( *,
'(a,i8)' )
' Column J = ', j
233 do k = adj_row(i), adj_row(i+1) - 1
235 if ( adj(k) == j )
then
237 else if ( adj(k) < j )
then
245 adj(j_spot+1:adj_num+1) = adj(j_spot:adj_num)
248 adj_row(i+1:node_num+1) = adj_row(i+1:node_num+1) + 1
250 adj_num = adj_num + 1
304 integer ( kind = 4 ) adj_num
305 integer ( kind = 4 ) node_num
307 integer ( kind = 4 ) adj(adj_num)
309 integer ( kind = 4 ) adj_row(node_num+1)
310 integer ( kind = 4 ) band_hi
311 integer ( kind = 4 ) band_lo
312 integer ( kind = 4 ) col
313 integer ( kind = 4 ) i
314 integer ( kind = 4 ) j
315 integer ( kind = 4 ) perm(node_num)
316 integer ( kind = 4 ) perm_inv(node_num)
323 do j = adj_row(perm(i)), adj_row(perm(i)+1) - 1
324 col = perm_inv(adj(j))
325 band_lo = max( band_lo, i - col )
326 band_hi = max( band_hi, col - i )
335 subroutine adj_perm_show ( node_num, adj_num, adj_row, adj, perm, perm_inv )
385 integer ( kind = 4 ),
parameter :: n_max = 100
387 integer ( kind = 4 ) adj_num
388 integer ( kind = 4 ) node_num
390 integer ( kind = 4 ) adj(adj_num)
391 integer ( kind = 4 ) adj_row(node_num+1)
392 character band(n_max)
393 integer ( kind = 4 ) band_lo
394 integer ( kind = 4 ) col
395 integer ( kind = 4 ) i
396 integer ( kind = 4 ) j
397 integer ( kind = 4 ) k
398 integer ( kind = 4 ) nonzero_num
399 integer ( kind = 4 ) perm(node_num)
400 integer ( kind = 4 ) perm_inv(node_num)
405 if ( n_max < node_num )
then
406 write ( *,
'(a)' )
' '
407 write ( *,
'(a)' )
'ADJ_PERM_SHOW - Fatal error!'
408 write ( *,
'(a)' )
' NODE_NUM is too large!'
409 write ( *,
'(a,i8)' )
' Maximum legal value is ', n_max
410 write ( *,
'(a,i8)' )
' Your input value was ', node_num
414 write ( *,
'(a)' )
' '
415 write ( *,
'(a)' )
' Nonzero structure of matrix:'
416 write ( *,
'(a)' )
' '
426 do j = adj_row(perm(i)), adj_row(perm(i)+1) - 1
428 col = perm_inv(adj(j))
431 nonzero_num = nonzero_num + 1
434 band_lo = max( band_lo, i - col )
442 write ( *,
'(2x,i8,1x,100a1)' ) i, band(1:node_num)
446 write ( *,
'(a)' )
' '
447 write ( *,
'(a,i8)' )
' Lower bandwidth = ', band_lo
448 write ( *,
'(a,i8,a)' )
' Lower envelope contains ', &
449 nonzero_num,
' nonzeros.'
453 subroutine adj_print ( node_num, adj_num, adj_row, adj, title )
499 integer ( kind = 4 ) adj_num
500 integer ( kind = 4 ) node_num
502 integer ( kind = 4 ) adj(adj_num)
503 integer ( kind = 4 ) adj_row(node_num+1)
504 character ( len = * ) title
506 call adj_print_some ( node_num, 1, node_num, adj_num, adj_row, adj, title )
560 integer ( kind = 4 ) adj_num
561 integer ( kind = 4 ) node_num
563 integer ( kind = 4 ) adj(adj_num)
564 integer ( kind = 4 ) adj_row(node_num+1)
565 integer ( kind = 4 ) i
566 integer ( kind = 4 ) jhi
567 integer ( kind = 4 ) jlo
568 integer ( kind = 4 ) jmax
569 integer ( kind = 4 ) jmin
570 integer ( kind = 4 ) node_hi
571 integer ( kind = 4 ) node_lo
572 character ( len = * ) title
574 write ( *,
'(a)' )
' '
575 write ( *,
'(a)' ) trim( title )
576 write ( *,
'(a)' )
' '
577 write ( *,
'(a)' )
' Sparse adjacency structure:'
578 write ( *,
'(a)' )
' '
579 write ( *,
'(a,i8)' )
' Number of nodes = ', node_num
580 write ( *,
'(a,i8)' )
' Number of adjacencies = ', adj_num
581 write ( *,
'(a)' )
' '
582 write ( *,
'(a)' )
' Node Min Max Nonzeros '
583 write ( *,
'(a)' )
' '
585 do i = node_lo, node_hi
588 jmax = adj_row(i+1) - 1
590 if ( jmax < jmin )
then
592 write ( *,
'(2x,3i4)' ) i, jmin, jmax
596 do jlo = jmin, jmax, 5
598 jhi = min( jlo + 4, jmax )
600 if ( jlo == jmin )
then
601 write ( *,
'(2x,3i4,3x,5i8)' ) i, jmin, jmax, adj(jlo:jhi)
603 write ( *,
'(2x,12x,3x,5i8)' ) adj(jlo:jhi)
614 subroutine adj_set ( node_num, adj_max, adj_num, adj_row, adj, irow, jcol )
672 integer ( kind = 4 ) adj_max
673 integer ( kind = 4 ) node_num
675 integer ( kind = 4 ) adj(adj_max)
676 logical adj_contains_ij
677 integer ( kind = 4 ) adj_num
678 integer ( kind = 4 ) adj_row(node_num+1)
679 integer ( kind = 4 ) irow
680 integer ( kind = 4 ) jcol
684 if ( irow < 0 .or. jcol < 0 )
then
686 write ( *,
'(a)' )
' '
687 write ( *,
'(a)' )
'ADJ_SET - Note:'
688 write ( *,
'(a)')
' Initializing adjacency information.'
689 write ( *,
'(a,i8)' )
' Number of nodes NODE_NUM = ', node_num
690 write ( *,
'(a,i8)' )
' Maximum adjacency ADJ_MAX = ', adj_max
693 adj_row(1:node_num+1) = 1
702 if ( irow == jcol )
then
706 if ( node_num < irow )
then
707 write ( *,
'(a)' )
' '
708 write ( *,
'(a)' )
'ADJ_SET - Fatal error!'
709 write ( *,
'(a)' )
' NODE_NUM < IROW.'
710 write ( *,
'(a,i8)' )
' IROW = ', irow
711 write ( *,
'(a,i8)' )
' NODE_NUM = ', node_num
713 else if ( irow < 1 )
then
714 write ( *,
'(a)' )
' '
715 write ( *,
'(a)' )
'ADJ_SET - Fatal error!'
716 write ( *,
'(a)' )
' IROW < 1.'
717 write ( *,
'(a,i8)' )
' IROW = ', irow
719 else if ( node_num < jcol )
then
720 write ( *,
'(a)' )
' '
721 write ( *,
'(a)' )
'ADJ_SET - Fatal error!'
722 write ( *,
'(a)' )
' NODE_NUM < JCOL.'
723 write ( *,
'(a,i8)' )
' JCOL = ', jcol
724 write ( *,
'(a,i8)' )
' NODE_NUM = ', node_num
726 else if ( jcol < 1 )
then
727 write ( *,
'(a)' )
' '
728 write ( *,
'(a)' )
'ADJ_SET - Fatal error!'
729 write ( *,
'(a)' )
' JCOL < 1.'
730 write ( *,
'(a,i8)' )
' JCOL = ', jcol
735 adj_contains_ij( node_num, adj_num, adj_row, adj, irow, jcol ) )
then
736 call adj_insert_ij ( node_num, adj_max, adj_num, adj_row, adj, irow, jcol )
740 adj_contains_ij( node_num, adj_num, adj_row, adj, jcol, irow ) )
then
741 call adj_insert_ij ( node_num, adj_max, adj_num, adj_row, adj, jcol, irow )
746 subroutine adj_show ( node_num, adj_num, adj_row, adj )
790 integer ( kind = 4 ),
parameter :: n_max = 100
792 integer ( kind = 4 ) adj_num
793 integer ( kind = 4 ) node_num
795 integer ( kind = 4 ) adj(adj_num)
796 integer ( kind = 4 ) adj_row(node_num+1)
797 character band(n_max)
798 integer ( kind = 4 ) band_lo
799 integer ( kind = 4 ) col
800 integer ( kind = 4 ) i
801 integer ( kind = 4 ) j
802 integer ( kind = 4 ) k
803 integer ( kind = 4 ) nonzero_num
808 if ( n_max < node_num )
then
809 write ( *,
'(a)' )
' '
810 write ( *,
'(a)' )
'ADJ_SHOW - Fatal error!'
811 write ( *,
'(a)' )
' NODE_NUM is too large!'
812 write ( *,
'(a,i8)' )
' Maximum legal value is ', n_max
813 write ( *,
'(a,i8)' )
' Your input value was ', node_num
817 write ( *,
'(a)' )
' '
818 write ( *,
'(a)' )
' Nonzero structure of matrix:'
819 write ( *,
'(a)' )
' '
829 do j = adj_row(i), adj_row(i+1) - 1
834 nonzero_num = nonzero_num + 1
837 band_lo = max( band_lo, i-col )
842 write ( *,
'(2x,i8,1x,100a1)' ) i, band(1:node_num)
846 write ( *,
'(a)' )
' '
847 write ( *,
'(a,i8)' )
' Lower bandwidth = ', band_lo
848 write ( *,
'(a,i8,a)' )
' Lower envelope contains ', &
849 nonzero_num,
' nonzeros.'
853 subroutine degree ( root, adj_num, adj_row, adj, mask, deg, iccsze, ls, &
914 integer ( kind = 4 ) adj_num
915 integer ( kind = 4 ) node_num
917 integer ( kind = 4 ) adj(adj_num)
918 integer ( kind = 4 ) adj_row(node_num+1)
919 integer ( kind = 4 ) deg(node_num)
920 integer ( kind = 4 ) i
921 integer ( kind = 4 ) iccsze
922 integer ( kind = 4 ) ideg
923 integer ( kind = 4 ) j
924 integer ( kind = 4 ) jstop
925 integer ( kind = 4 ) jstrt
926 integer ( kind = 4 ) lbegin
927 integer ( kind = 4 ) ls(node_num)
928 integer ( kind = 4 ) lvlend
929 integer ( kind = 4 ) lvsize
930 integer ( kind = 4 ) mask(node_num)
931 integer ( kind = 4 ) nbr
932 integer ( kind = 4 ) node
933 integer ( kind = 4 ) root
938 adj_row(root) = -adj_row(root)
953 do i = lbegin, lvlend
956 jstrt = -adj_row(node)
957 jstop = abs( adj_row(node+1) ) - 1
964 if ( mask(nbr) /= 0 )
then
968 if ( 0 <= adj_row(nbr) )
then
969 adj_row(nbr) = -adj_row(nbr)
984 lvsize = iccsze - lvlend
988 if ( lvsize == 0 )
then
998 adj_row(node) = -adj_row(node)
1003 subroutine genrcm ( node_num, adj_num, adj_row, adj, perm )
1057 integer ( kind = 4 ) adj_num
1058 integer ( kind = 4 ) node_num
1060 integer ( kind = 4 ) adj(adj_num)
1061 integer ( kind = 4 ) adj_row(node_num+1)
1062 integer ( kind = 4 ) i
1063 integer ( kind = 4 ) iccsze
1064 integer ( kind = 4 ) mask(node_num)
1065 integer ( kind = 4 ) level_num
1066 integer ( kind = 4 ) level_row(node_num+1)
1067 integer ( kind = 4 ) num
1068 integer ( kind = 4 ) perm(node_num)
1069 integer ( kind = 4 ) root
1071 mask(1:node_num) = 1
1079 if ( mask(i) /= 0 )
then
1086 call root_find ( root, adj_num, adj_row, adj, mask, level_num, &
1087 level_row, perm(num), node_num )
1091 call rcm ( root, adj_num, adj_row, adj, mask, perm(num), iccsze, &
1098 if ( node_num < num )
then
1144 integer ( kind = 4 ) adj_num
1145 integer ( kind = 4 ) node_num
1147 integer ( kind = 4 ) adj(adj_num)
1148 integer ( kind = 4 ) adj_row(node_num+1)
1150 adj(1:adj_num) = (/ &
1162 adj_row(1:node_num+1) = (/ 1, 3, 7, 10, 14, 17, 21, 25, 27, 28, 29 /)
1199 integer ( kind = 4 ) adj_num
1200 integer ( kind = 4 ) node_num
1232 integer ( kind = 4 ) i
1233 integer ( kind = 4 ) j
1234 integer ( kind = 4 ) k
1307 integer ( kind = 4 ) a
1308 integer ( kind = 4 ) b
1309 integer ( kind = 4 ),
parameter :: i4_huge = 2147483647
1311 integer ( kind = 4 ) k
1313 integer ( kind = 4 ) seed
1314 integer ( kind = 4 ) value
1316 if ( seed == 0 )
then
1317 write ( *,
'(a)' )
' '
1318 write ( *,
'(a)' )
'I4_UNIFORM_AB - Fatal error!'
1319 write ( *,
'(a)' )
' Input value of SEED = 0.'
1325 seed = 16807 * ( seed - k * 127773 ) - k * 2836
1327 if ( seed < 0 )
then
1328 seed = seed + i4_huge
1331 r = real( seed, kind = 4 ) * 4.656612875e-10
1335 r = ( 1.0e+00 - r ) * ( real( min( a, b ), kind = 4 ) - 0.5e+00 ) &
1336 + r * ( real( max( a, b ), kind = 4 ) + 0.5e+00 )
1340 value = nint( r, kind = 4 )
1342 value = max(
value, min( a, b ) )
1343 value = min(
value, max( a, b ) )
1399 integer ( kind = 4 ) m
1400 integer ( kind = 4 ) n
1402 integer ( kind = 4 ) a(m,n)
1403 integer ( kind = 4 ) i
1404 integer ( kind = 4 ) isgn
1405 integer ( kind = 4 ) j
1406 integer ( kind = 4 ) k
1410 if ( i < 1 .or. n < i )
then
1411 write ( *,
'(a)' )
' '
1412 write ( *,
'(a)' )
'I4COL_COMPARE - Fatal error!'
1413 write ( *,
'(a)' )
' Column index I is out of bounds.'
1417 if ( j < 1 .or. n < j )
then
1418 write ( *,
'(a)' )
' '
1419 write ( *,
'(a)' )
'I4COL_COMPARE - Fatal error!'
1420 write ( *,
'(a)' )
' Column index J is out of bounds.'
1434 if ( a(k,i) < a(k,j) )
then
1437 else if ( a(k,j) < a(k,i) )
then
1492 integer ( kind = 4 ) m
1493 integer ( kind = 4 ) n
1495 integer ( kind = 4 ) a(m,n)
1496 integer ( kind = 4 ) i
1497 integer ( kind = 4 ) indx
1498 integer ( kind = 4 ) isgn
1499 integer ( kind = 4 ) j
1524 if ( 0 < indx )
then
1530 else if ( indx < 0 )
then
1534 else if ( indx == 0 )
then
1592 integer ( kind = 4 ) m
1593 integer ( kind = 4 ) n
1595 integer ( kind = 4 ) a(m,n)
1596 integer ( kind = 4 ) col(m)
1597 integer ( kind = 4 ) i
1598 integer ( kind = 4 ) j
1600 if ( i < 1 .or. n < i .or. j < 1 .or. n < j )
then
1602 write ( *,
'(a)' )
' '
1603 write ( *,
'(a)' )
'I4COL_SWAP - Fatal error!'
1604 write ( *,
'(a)' )
' I or J is out of bounds.'
1605 write ( *,
'(a,i8)' )
' I = ', i
1606 write ( *,
'(a,i8)' )
' J = ', j
1607 write ( *,
'(a,i8)' )
' N = ', n
1654 integer ( kind = 4 ),
parameter :: incx = 10
1655 integer ( kind = 4 ) m
1656 integer ( kind = 4 ) n
1658 integer ( kind = 4 ) a(m,n)
1659 character ( len = 7 ) ctemp(incx)
1660 integer ( kind = 4 ) i
1661 integer ( kind = 4 ) i2hi
1662 integer ( kind = 4 ) i2lo
1663 integer ( kind = 4 ) ihi
1664 integer ( kind = 4 ) ilo
1665 integer ( kind = 4 ) inc
1666 integer ( kind = 4 ) j
1667 integer ( kind = 4 ) j2
1668 integer ( kind = 4 ) j2hi
1669 integer ( kind = 4 ) j2lo
1670 integer ( kind = 4 ) jhi
1671 integer ( kind = 4 ) jlo
1672 character ( len = * ) title
1674 write ( *,
'(a)' )
' '
1675 write ( *,
'(a)' ) trim( title )
1677 do j2lo = max( jlo, 1 ), min( jhi, n ), incx
1679 j2hi = j2lo + incx - 1
1680 j2hi = min( j2hi, n )
1681 j2hi = min( j2hi, jhi )
1683 inc = j2hi + 1 - j2lo
1685 write ( *,
'(a)' )
' '
1689 write ( ctemp(j2),
'(i7)') j
1692 write ( *,
'('' Col '',10a7)' ) ctemp(1:inc)
1693 write ( *,
'(a)' )
' Row'
1694 write ( *,
'(a)' )
' '
1696 i2lo = max( ilo, 1 )
1697 i2hi = min( ihi, m )
1705 write ( ctemp(j2),
'(i7)' ) a(i,j)
1709 write ( *,
'(i5,1x,10a7)' ) i, ( ctemp(j), j = 1, inc )
1745 integer ( kind = 4 ) m
1746 integer ( kind = 4 ) n
1748 integer ( kind = 4 ) a(m,n)
1749 character ( len = * ) title
1787 integer ( kind = 4 ),
parameter :: incx = 10
1788 integer ( kind = 4 ) m
1789 integer ( kind = 4 ) n
1791 integer ( kind = 4 ) a(m,n)
1792 character ( len = 7 ) ctemp(incx)
1793 integer ( kind = 4 ) i
1794 integer ( kind = 4 ) i2
1795 integer ( kind = 4 ) i2hi
1796 integer ( kind = 4 ) i2lo
1797 integer ( kind = 4 ) ihi
1798 integer ( kind = 4 ) ilo
1799 integer ( kind = 4 ) inc
1800 integer ( kind = 4 ) j
1801 integer ( kind = 4 ) j2hi
1802 integer ( kind = 4 ) j2lo
1803 integer ( kind = 4 ) jhi
1804 integer ( kind = 4 ) jlo
1805 character ( len = * ) title
1807 write ( *,
'(a)' )
' '
1808 write ( *,
'(a)' ) trim( title )
1810 do i2lo = max( ilo, 1 ), min( ihi, m ), incx
1812 i2hi = i2lo + incx - 1
1813 i2hi = min( i2hi, m )
1814 i2hi = min( i2hi, ihi )
1816 inc = i2hi + 1 - i2lo
1818 write ( *,
'(a)' )
' '
1822 write ( ctemp(i2),
'(i7)') i
1825 write ( *,
'('' Row '',10a7)' ) ctemp(1:inc)
1826 write ( *,
'(a)' )
' Col'
1827 write ( *,
'(a)' )
' '
1829 j2lo = max( jlo, 1 )
1830 j2hi = min( jhi, n )
1838 write ( ctemp(i2),
'(i7)' ) a(i,j)
1842 write ( *,
'(i5,1x,10a7)' ) j, ( ctemp(i), i = 1, inc )
1848 write ( *,
'(a)' )
' '
1903 integer ( kind = 4 ) n
1905 integer ( kind = 4 ) a(n)
1906 integer ( kind = 4 ) i
1907 integer ( kind = 4 ) ifree
1908 integer ( kind = 4 ) key
1909 integer ( kind = 4 ) m
1936 if ( m + 1 <= n )
then
1941 if ( a(m) < a(m+1) )
then
1951 if ( a(m) <= key )
then
1994 integer ( kind = 4 ) n
1996 integer ( kind = 4 ) a(n)
1997 integer ( kind = 4 ) i
2034 integer ( kind = 4 ) n
2036 integer ( kind = 4 ) a(n)
2037 integer ( kind = 4 ) big
2038 integer ( kind = 4 ) i
2039 character ( len = * ) title
2041 if ( 0 < len_trim( title ) )
then
2042 write ( *,
'(a)' )
' '
2043 write ( *,
'(a)' ) trim( title )
2046 big = maxval( abs( a(1:n) ) )
2048 write ( *,
'(a)' )
' '
2049 if ( big < 1000 )
then
2051 write ( *,
'(2x,i8,2x,i4)' ) i, a(i)
2053 else if ( big < 1000000 )
then
2055 write ( *,
'(2x,i8,2x,i7)' ) i, a(i)
2059 write ( *,
'(2x,i8,2x,i12)' ) i, a(i)
2102 integer ( kind = 4 ) n
2104 integer ( kind = 4 ) a(n)
2105 integer ( kind = 4 ) i
2108 call i4_swap ( a(i), a(n+1-i) )
2152 integer ( kind = 4 ) n
2154 integer ( kind = 4 ) a(n)
2155 integer ( kind = 4 ) n1
2174 do n1 = n - 1, 2, -1
2188 subroutine level_set ( root, adj_num, adj_row, adj, mask, level_num, &
2189 level_row, level, node_num )
2252 integer ( kind = 4 ) adj_num
2253 integer ( kind = 4 ) node_num
2255 integer ( kind = 4 ) adj(adj_num)
2256 integer ( kind = 4 ) adj_row(node_num+1)
2257 integer ( kind = 4 ) i
2258 integer ( kind = 4 ) iccsze
2259 integer ( kind = 4 ) j
2260 integer ( kind = 4 ) jstop
2261 integer ( kind = 4 ) jstrt
2262 integer ( kind = 4 ) lbegin
2263 integer ( kind = 4 ) level_num
2264 integer ( kind = 4 ) level_row(node_num+1)
2265 integer ( kind = 4 ) level(node_num)
2266 integer ( kind = 4 ) lvlend
2267 integer ( kind = 4 ) lvsize
2268 integer ( kind = 4 ) mask(node_num)
2269 integer ( kind = 4 ) nbr
2270 integer ( kind = 4 ) node
2271 integer ( kind = 4 ) root
2286 level_num = level_num + 1
2287 level_row(level_num) = lbegin
2292 do i = lbegin, lvlend
2295 jstrt = adj_row(node)
2296 jstop = adj_row(node+1) - 1
2302 if ( mask(nbr) /= 0 )
then
2315 lvsize = iccsze - lvlend
2317 if ( lvsize <= 0 )
then
2323 level_row(level_num+1) = lvlend + 1
2327 mask(level(1:iccsze)) = 1
2364 integer ( kind = 4 ) level_num
2365 integer ( kind = 4 ) node_num
2367 integer ( kind = 4 ) level(node_num)
2368 integer ( kind = 4 ) level_row(level_num+1)
2369 integer ( kind = 4 ) i
2370 integer ( kind = 4 ) jhi
2371 integer ( kind = 4 ) jlo
2372 integer ( kind = 4 ) jmax
2373 integer ( kind = 4 ) jmin
2375 write ( *,
'(a)' )
' '
2376 write ( *,
'(a)' )
'LEVEL_SET_PRINT'
2377 write ( *,
'(a)' )
' Show the level set structure of a rooted graph.'
2378 write ( *,
'(a,i8)' )
' The number of nodes is ', node_num
2379 write ( *,
'(a,i8)' )
' The number of levels is ', level_num
2380 write ( *,
'(a)' )
' '
2381 write ( *,
'(a)' )
' Level Min Max Nonzeros '
2382 write ( *,
'(a)' )
' '
2387 jmax = level_row(i+1) - 1
2389 if ( jmax < jmin )
then
2391 write ( *,
'(2x,3i4,6x,10i8)' ) i, jmin, jmax
2395 do jlo = jmin, jmax, 5
2397 jhi = min( jlo + 4, jmax )
2399 if ( jlo == jmin )
then
2400 write ( *,
'(2x,3i4,3x,5i8)' ) i, jmin, jmax, level(jlo:jhi)
2402 write ( *,
'(2x,12x,3x,5i8)' ) level(jlo:jhi)
2449 integer ( kind = 4 ) n
2451 integer ( kind = 4 ) ierror
2452 integer ( kind = 4 ) ifind
2453 integer ( kind = 4 ) iseek
2454 integer ( kind = 4 ) p(n)
2463 if ( p(ifind) == iseek )
then
2469 if ( ierror /= 0 )
then
2505 integer ( kind = 4 ) n
2507 integer ( kind = 4 ) i
2508 integer ( kind = 4 ) perm(n)
2509 integer ( kind = 4 ) perm_inv(n)
2512 perm_inv(perm(i)) = i
2559 integer ( kind = 4 ) n
2561 integer ( kind = 4 ) i
2562 integer ( kind = 4 ) i4_uniform_ab
2563 integer ( kind = 4 ) j
2564 integer ( kind = 4 ) p(n)
2565 integer ( kind = 4 ) seed
2570 j = i4_uniform_ab( i, n, seed )
2631 integer ( kind = 4 ) n
2632 integer ( kind = 4 ),
parameter :: ndim = 2
2634 real ( kind = 8 ) a(ndim,n)
2635 real ( kind = 8 ) a_temp(ndim)
2636 integer ( kind = 4 ) ierror
2637 integer ( kind = 4 ) iget
2638 integer ( kind = 4 ) iput
2639 integer ( kind = 4 ) istart
2640 integer ( kind = 4 ) p(n)
2644 if ( ierror /= 0 )
then
2645 write ( *,
'(a)' )
' '
2646 write ( *,
'(a)' )
'R82VEC_PERMUTE - Fatal error!'
2647 write ( *,
'(a)' )
' The input array does not represent'
2648 write ( *,
'(a)' )
' a proper permutation. In particular, the'
2649 write ( *,
'(a,i8)' )
' array is missing the value ', ierror
2657 if ( p(istart) < 0 )
then
2661 else if ( p(istart) == istart )
then
2663 p(istart) = -p(istart)
2668 a_temp(1:ndim) = a(1:ndim,istart)
2680 if ( iget < 1 .or. n < iget )
then
2681 write ( *,
'(a)' )
' '
2682 write ( *,
'(a)' )
'R82VEC_PERMUTE - Fatal error!'
2683 write ( *,
'(a)' )
' A permutation index is out of range.'
2684 write ( *,
'(a,i8,a,i8)' )
' P(', iput,
') = ', iget
2688 if ( iget == istart )
then
2689 a(1:ndim,iput) = a_temp(1:ndim)
2693 a(1:ndim,iput) = a(1:ndim,iget)
2739 integer ( kind = 4 ),
parameter :: incx = 5
2740 integer ( kind = 4 ) m
2741 integer ( kind = 4 ) n
2743 real ( kind = 8 ) a(m,n)
2744 character ( len = 14 ) ctemp(incx)
2746 integer ( kind = 4 ) i
2747 integer ( kind = 4 ) i2hi
2748 integer ( kind = 4 ) i2lo
2749 integer ( kind = 4 ) ihi
2750 integer ( kind = 4 ) ilo
2751 integer ( kind = 4 ) inc
2752 integer ( kind = 4 ) j
2753 integer ( kind = 4 ) j2
2754 integer ( kind = 4 ) j2hi
2755 integer ( kind = 4 ) j2lo
2756 integer ( kind = 4 ) jhi
2757 integer ( kind = 4 ) jlo
2758 character ( len = * ) title
2760 if ( 0 < len_trim( title ) )
then
2761 write ( *,
'(a)' )
' '
2762 write ( *,
'(a)' ) trim( title )
2765 do j2lo = max( jlo, 1 ), min( jhi, n ), incx
2767 j2hi = j2lo + incx - 1
2768 j2hi = min( j2hi, n )
2769 j2hi = min( j2hi, jhi )
2771 inc = j2hi + 1 - j2lo
2773 write ( *,
'(a)' )
' '
2777 write ( ctemp(j2),
'(i7,7x)') j
2780 write ( *,
'('' Col '',5a14)' ) ctemp(1:inc)
2781 write ( *,
'(a)' )
' Row'
2782 write ( *,
'(a)' )
' '
2784 i2lo = max( ilo, 1 )
2785 i2hi = min( ihi, m )
2793 write ( ctemp(j2),
'(g14.6)' ) a(i,j)
2797 write ( *,
'(i5,1x,5a14)' ) i, ( ctemp(j), j = 1, inc )
2837 integer ( kind = 4 ),
parameter :: incx = 5
2838 integer ( kind = 4 ) m
2839 integer ( kind = 4 ) n
2841 real ( kind = 8 ) a(m,n)
2842 character ( len = 14 ) ctemp(incx)
2843 integer ( kind = 4 ) i
2844 integer ( kind = 4 ) i2
2845 integer ( kind = 4 ) i2hi
2846 integer ( kind = 4 ) i2lo
2847 integer ( kind = 4 ) ihi
2848 integer ( kind = 4 ) ilo
2849 integer ( kind = 4 ) inc
2850 integer ( kind = 4 ) j
2851 integer ( kind = 4 ) j2hi
2852 integer ( kind = 4 ) j2lo
2853 integer ( kind = 4 ) jhi
2854 integer ( kind = 4 ) jlo
2855 character ( len = * ) title
2857 if ( 0 < len_trim( title ) )
then
2858 write ( *,
'(a)' )
' '
2859 write ( *,
'(a)' ) trim( title )
2862 do i2lo = max( ilo, 1 ), min( ihi, m ), incx
2864 i2hi = i2lo + incx - 1
2865 i2hi = min( i2hi, m )
2866 i2hi = min( i2hi, ihi )
2868 inc = i2hi + 1 - i2lo
2870 write ( *,
'(a)' )
' '
2874 write ( ctemp(i2),
'(i7,7x)') i
2877 write ( *,
'('' Row '',5a14)' ) ctemp(1:inc)
2878 write ( *,
'(a)' )
' Col'
2879 write ( *,
'(a)' )
' '
2881 j2lo = max( jlo, 1 )
2882 j2hi = min( jhi, n )
2888 write ( ctemp(i2),
'(g14.6)' ) a(i,j)
2891 write ( *,
'(i5,1x,5a14)' ) j, ( ctemp(i), i = 1, inc )
2899 subroutine rcm ( root, adj_num, adj_row, adj, mask, perm, iccsze, node_num )
2973 integer ( kind = 4 ) adj_num
2974 integer ( kind = 4 ) node_num
2976 integer ( kind = 4 ) adj(adj_num)
2977 integer ( kind = 4 ) adj_row(node_num+1)
2978 integer ( kind = 4 ) deg(node_num)
2979 integer ( kind = 4 ) fnbr
2980 integer ( kind = 4 ) i
2981 integer ( kind = 4 ) iccsze
2982 integer ( kind = 4 ) j
2983 integer ( kind = 4 ) jstop
2984 integer ( kind = 4 ) jstrt
2985 integer ( kind = 4 ) k
2986 integer ( kind = 4 ) l
2987 integer ( kind = 4 ) lbegin
2988 integer ( kind = 4 ) lnbr
2989 integer ( kind = 4 ) lperm
2990 integer ( kind = 4 ) lvlend
2991 integer ( kind = 4 ) mask(node_num)
2992 integer ( kind = 4 ) nbr
2993 integer ( kind = 4 ) node
2994 integer ( kind = 4 ) perm(node_num)
2995 integer ( kind = 4 ) root
2999 if ( node_num < 1 )
then
3000 write ( *,
'(a)' )
' '
3001 write ( *,
'(a)' )
'RCM - Fatal error!'
3002 write ( *,
'(a,i4)' )
' Illegal input value of NODE_NUM = ', node_num
3003 write ( *,
'(a,i4)' )
' Acceptable values must be positive.'
3009 if ( root < 1 .or. node_num < root )
then
3010 write ( *,
'(a)' )
' '
3011 write ( *,
'(a)' )
'RCM - Fatal error!'
3012 write ( *,
'(a,i4)' )
' Illegal input value of ROOT = ', root
3013 write ( *,
'(a,i4)' )
' Acceptable values are between 1 and ', node_num
3019 call degree ( root, adj_num, adj_row, adj, mask, deg, iccsze, perm, node_num )
3023 if ( iccsze < 1 )
then
3024 write ( *,
'(a)' )
' '
3025 write ( *,
'(a)' )
'RCM - Fatal error!'
3026 write ( *,
'(a,i4)' )
' Inexplicable component size ICCSZE = ', iccsze
3032 if ( iccsze == 1 )
then
3044 do while ( lvlend < lnbr )
3049 do i = lbegin, lvlend
3054 jstrt = adj_row(node)
3055 jstop = adj_row(node+1) - 1
3068 if ( mask(nbr) /= 0 )
then
3078 if ( lnbr <= fnbr )
then
3087 do while ( k < lnbr )
3093 do while ( fnbr < l )
3097 if ( deg(lperm) <= deg(nbr) )
then
3121 subroutine root_find ( root, adj_num, adj_row, adj, mask, level_num, &
3122 level_row, level, node_num )
3211 integer ( kind = 4 ) adj_num
3212 integer ( kind = 4 ) node_num
3214 integer ( kind = 4 ) adj(adj_num)
3215 integer ( kind = 4 ) adj_row(node_num+1)
3216 integer ( kind = 4 ) iccsze
3217 integer ( kind = 4 ) j
3218 integer ( kind = 4 ) jstrt
3219 integer ( kind = 4 ) k
3220 integer ( kind = 4 ) kstop
3221 integer ( kind = 4 ) kstrt
3222 integer ( kind = 4 ) level(node_num)
3223 integer ( kind = 4 ) level_num
3224 integer ( kind = 4 ) level_num2
3225 integer ( kind = 4 ) level_row(node_num+1)
3226 integer ( kind = 4 ) mask(node_num)
3227 integer ( kind = 4 ) mindeg
3228 integer ( kind = 4 ) nabor
3229 integer ( kind = 4 ) ndeg
3230 integer ( kind = 4 ) node
3231 integer ( kind = 4 ) root
3235 call level_set ( root, adj_num, adj_row, adj, mask, level_num, &
3236 level_row, level, node_num )
3240 iccsze = level_row(level_num+1) - 1
3246 if ( level_num == 1 )
then
3254 if ( level_num == iccsze )
then
3265 jstrt = level_row(level_num)
3268 if ( jstrt < iccsze )
then
3270 do j = jstrt, iccsze
3274 kstrt = adj_row(node)
3275 kstop = adj_row(node+1) - 1
3279 if ( 0 < mask(nabor) )
then
3284 if ( ndeg < mindeg )
then
3295 call level_set ( root, adj_num, adj_row, adj, mask, level_num2, &
3296 level_row, level, node_num )
3300 if ( level_num2 <= level_num )
then
3304 level_num = level_num2
3309 if ( iccsze <= level_num )
then
3386 integer ( kind = 4 ) i
3387 integer ( kind = 4 ),
save :: i_save = 0
3388 integer ( kind = 4 ) indx
3389 integer ( kind = 4 ) isgn
3390 integer ( kind = 4 ) j
3391 integer ( kind = 4 ),
save :: j_save = 0
3392 integer ( kind = 4 ),
save :: k = 0
3393 integer ( kind = 4 ),
save :: k1 = 0
3394 integer ( kind = 4 ) n
3395 integer ( kind = 4 ),
save :: n1 = 0
3399 if ( indx == 0 )
then
3409 else if ( indx < 0 )
then
3411 if ( indx == -2 )
then
3413 if ( isgn < 0 )
then
3426 if ( 0 < isgn )
then
3457 else if ( indx == 1 )
then
3467 if ( i_save == n1 )
then
3474 else if ( i_save <= n1 )
then
3536 character ( len = 8 ) ampm
3537 integer ( kind = 4 ) d
3538 integer ( kind = 4 ) h
3539 integer ( kind = 4 ) m
3540 integer ( kind = 4 ) mm
3541 character ( len = 9 ),
parameter,
dimension(12) :: month = (/ &
3542 'January ',
'February ',
'March ',
'April ', &
3543 'May ',
'June ',
'July ',
'August ', &
3544 'September',
'October ',
'November ',
'December ' /)
3545 integer ( kind = 4 ) n
3546 integer ( kind = 4 ) s
3547 integer ( kind = 4 ) values(8)
3548 integer ( kind = 4 ) y
3550 call date_and_time ( values = values )
3562 else if ( h == 12 )
then
3563 if ( n == 0 .and. s == 0 )
then
3572 else if ( h == 12 )
then
3573 if ( n == 0 .and. s == 0 )
then
3581 write ( *,
'(i2,1x,a,1x,i4,2x,i2,a1,i2.2,a1,i2.2,a1,i3.3,1x,a)' ) &
3582 d, trim( month(m) ), y, h,
':', n,
':', s,
'.', mm, trim( ampm )
3588 triangle_node, triangle_neighbor )
3697 integer ( kind = 4 ) triangle_num
3698 integer ( kind = 4 ) triangle_order
3700 integer ( kind = 4 ) col(4,3*triangle_num)
3701 integer ( kind = 4 ) i
3702 integer ( kind = 4 ) icol
3703 integer ( kind = 4 ) j
3704 integer ( kind = 4 ) k
3705 integer ( kind = 4 ) side1
3706 integer ( kind = 4 ) side2
3707 integer ( kind = 4 ) triangle_neighbor(3,triangle_num)
3708 integer ( kind = 4 ) tri
3709 integer ( kind = 4 ) triangle_node(triangle_order,triangle_num)
3710 integer ( kind = 4 ) tri1
3711 integer ( kind = 4 ) tri2
3723 do tri = 1, triangle_num
3725 i = triangle_node(1,tri)
3726 j = triangle_node(2,tri)
3727 k = triangle_node(3,tri)
3730 col(1:4,3*(tri-1)+1) = (/ i, j, 3, tri /)
3732 col(1:4,3*(tri-1)+1) = (/ j, i, 3, tri /)
3736 col(1:4,3*(tri-1)+2) = (/ j, k, 1, tri /)
3738 col(1:4,3*(tri-1)+2) = (/ k, j, 1, tri /)
3742 col(1:4,3*(tri-1)+3) = (/ k, i, 2, tri /)
3744 col(1:4,3*(tri-1)+3) = (/ i, k, 2, tri /)
3765 triangle_neighbor(1:3,1:triangle_num) = -1
3771 if ( 3 * triangle_num <= icol )
then
3775 if ( col(1,icol) /= col(1,icol+1) .or. col(2,icol) /= col(2,icol+1) )
then
3782 side2 = col(3,icol+1)
3783 tri2 = col(4,icol+1)
3785 triangle_neighbor(side1,tri1) = tri2
3786 triangle_neighbor(side2,tri2) = tri1
3795 triangle_node, triangle_neighbor, adj_num, adj_col )
3918 integer ( kind = 4 ) node_num
3919 integer ( kind = 4 ) triangle_num
3920 integer ( kind = 4 ),
parameter :: triangle_order = 3
3922 integer ( kind = 4 ) adj_num
3923 integer ( kind = 4 ) adj_col(node_num+1)
3924 integer ( kind = 4 ) i
3925 integer ( kind = 4 ) n1
3926 integer ( kind = 4 ) n2
3927 integer ( kind = 4 ) n3
3928 integer ( kind = 4 ) triangle
3929 integer ( kind = 4 ) triangle2
3930 integer ( kind = 4 ) triangle_neighbor(3,triangle_num)
3931 integer ( kind = 4 ) triangle_node(triangle_order,triangle_num)
3937 adj_col(1:node_num) = 1
3941 do triangle = 1, triangle_num
3943 n1 = triangle_node(1,triangle)
3944 n2 = triangle_node(2,triangle)
3945 n3 = triangle_node(3,triangle)
3952 triangle2 = triangle_neighbor(1,triangle)
3954 if ( triangle2 < 0 .or. triangle < triangle2 )
then
3955 adj_col(n1) = adj_col(n1) + 1
3956 adj_col(n2) = adj_col(n2) + 1
3961 triangle2 = triangle_neighbor(2,triangle)
3963 if ( triangle2 < 0 .or. triangle < triangle2 )
then
3964 adj_col(n2) = adj_col(n2) + 1
3965 adj_col(n3) = adj_col(n3) + 1
3970 triangle2 = triangle_neighbor(3,triangle)
3972 if ( triangle2 < 0 .or. triangle < triangle2 )
then
3973 adj_col(n1) = adj_col(n1) + 1
3974 adj_col(n3) = adj_col(n3) + 1
3982 adj_col(2:node_num+1) = adj_col(1:node_num)
3985 do i = 2, node_num + 1
3986 adj_col(i) = adj_col(i-1) + adj_col(i)
3989 adj_num = adj_col(node_num+1) - 1
3994 triangle_node, triangle_neighbor, adj_num, adj_col, adj )
4123 integer ( kind = 4 ) adj_num
4124 integer ( kind = 4 ) node_num
4125 integer ( kind = 4 ) triangle_num
4126 integer ( kind = 4 ),
parameter :: triangle_order = 3
4128 integer ( kind = 4 ) adj(adj_num)
4129 integer ( kind = 4 ) adj_copy(node_num)
4130 integer ( kind = 4 ) adj_col(node_num+1)
4131 integer ( kind = 4 ) k1
4132 integer ( kind = 4 ) k2
4133 integer ( kind = 4 ) n1
4134 integer ( kind = 4 ) n2
4135 integer ( kind = 4 ) n3
4136 integer ( kind = 4 ) node
4137 integer ( kind = 4 ) triangle
4138 integer ( kind = 4 ) triangle2
4139 integer ( kind = 4 ) triangle_neighbor(3,triangle_num)
4140 integer ( kind = 4 ) triangle_node(triangle_order,triangle_num)
4143 adj_copy(1:node_num) = adj_col(1:node_num)
4147 do node = 1, node_num
4148 adj(adj_copy(node)) = node
4149 adj_copy(node) = adj_copy(node) + 1
4154 do triangle = 1, triangle_num
4156 n1 = triangle_node(1,triangle)
4157 n2 = triangle_node(2,triangle)
4158 n3 = triangle_node(3,triangle)
4165 triangle2 = triangle_neighbor(1,triangle)
4167 if ( triangle2 < 0 .or. triangle < triangle2 )
then
4168 adj(adj_copy(n1)) = n2
4169 adj_copy(n1) = adj_copy(n1) + 1
4170 adj(adj_copy(n2)) = n1
4171 adj_copy(n2) = adj_copy(n2) + 1
4176 triangle2 = triangle_neighbor(2,triangle)
4178 if ( triangle2 < 0 .or. triangle < triangle2 )
then
4179 adj(adj_copy(n2)) = n3
4180 adj_copy(n2) = adj_copy(n2) + 1
4181 adj(adj_copy(n3)) = n2
4182 adj_copy(n3) = adj_copy(n3) + 1
4187 triangle2 = triangle_neighbor(3,triangle)
4189 if ( triangle2 < 0 .or. triangle < triangle2 )
then
4190 adj(adj_copy(n1)) = n3
4191 adj_copy(n1) = adj_copy(n1) + 1
4192 adj(adj_copy(n3)) = n1
4193 adj_copy(n3) = adj_copy(n3) + 1
4200 do node = 1, node_num
4202 k2 = adj_col(node+1) - 1
4209 triangle_node, triangle_neighbor )
4268 integer ( kind = 4 ),
parameter :: dim_num = 2
4269 integer ( kind = 4 ) node_num
4270 integer ( kind = 4 ) triangle_num
4271 integer ( kind = 4 ),
parameter :: triangle_order = 3
4273 real ( kind = 8 ) node_xy(dim_num,node_num)
4274 integer ( kind = 4 ) triangle_neighbor(3,triangle_num)
4275 integer ( kind = 4 ) triangle_node(triangle_order,triangle_num)
4277 node_xy = reshape( (/ &
4303 /), (/ dim_num, node_num /) )
4305 triangle_node(1:triangle_order,1:triangle_num) = reshape( (/ &
4337 25, 24, 20 /), (/ triangle_order, triangle_num /) )
4339 triangle_neighbor(1:3,1:triangle_num) = reshape( (/ &
4371 -1, 31, -1 /), (/ 3, triangle_num /) )
4420 integer ( kind = 4 ) hole_num
4421 integer ( kind = 4 ) node_num
4422 integer ( kind = 4 ) triangle_num
4431 triangle_node, triangle_neighbor, adj_num, adj_col )
4586 integer ( kind = 4 ) node_num
4587 integer ( kind = 4 ) triangle_num
4588 integer ( kind = 4 ),
parameter :: triangle_order = 6
4590 integer ( kind = 4 ) adj_num
4591 integer ( kind = 4 ) adj_col(node_num+1)
4592 integer ( kind = 4 ) i
4593 integer ( kind = 4 ) n1
4594 integer ( kind = 4 ) n2
4595 integer ( kind = 4 ) n3
4596 integer ( kind = 4 ) n4
4597 integer ( kind = 4 ) n5
4598 integer ( kind = 4 ) n6
4599 integer ( kind = 4 ) triangle
4600 integer ( kind = 4 ) triangle2
4601 integer ( kind = 4 ) triangle_neighbor(3,triangle_num)
4602 integer ( kind = 4 ) triangle_node(triangle_order,triangle_num)
4608 adj_col(1:node_num) = 1
4612 do triangle = 1, triangle_num
4614 n1 = triangle_node(1,triangle)
4615 n2 = triangle_node(2,triangle)
4616 n3 = triangle_node(3,triangle)
4617 n4 = triangle_node(4,triangle)
4618 n5 = triangle_node(5,triangle)
4619 n6 = triangle_node(6,triangle)
4629 adj_col(n3) = adj_col(n3) + 1
4630 adj_col(n4) = adj_col(n4) + 1
4631 adj_col(n1) = adj_col(n1) + 1
4632 adj_col(n5) = adj_col(n5) + 1
4633 adj_col(n4) = adj_col(n4) + 1
4634 adj_col(n5) = adj_col(n5) + 1
4635 adj_col(n2) = adj_col(n2) + 1
4636 adj_col(n6) = adj_col(n6) + 1
4637 adj_col(n4) = adj_col(n4) + 1
4638 adj_col(n6) = adj_col(n6) + 1
4639 adj_col(n5) = adj_col(n5) + 1
4640 adj_col(n6) = adj_col(n6) + 1
4652 triangle2 = triangle_neighbor(1,triangle)
4654 if ( triangle2 < 0 .or. triangle < triangle2 )
then
4655 adj_col(n1) = adj_col(n1) + 1
4656 adj_col(n2) = adj_col(n2) + 1
4657 adj_col(n1) = adj_col(n1) + 1
4658 adj_col(n4) = adj_col(n4) + 1
4659 adj_col(n2) = adj_col(n2) + 1
4660 adj_col(n4) = adj_col(n4) + 1
4668 triangle2 = triangle_neighbor(2,triangle)
4670 if ( triangle2 < 0 .or. triangle < triangle2 )
then
4671 adj_col(n2) = adj_col(n2) + 1
4672 adj_col(n3) = adj_col(n3) + 1
4673 adj_col(n2) = adj_col(n2) + 1
4674 adj_col(n5) = adj_col(n5) + 1
4675 adj_col(n3) = adj_col(n3) + 1
4676 adj_col(n5) = adj_col(n5) + 1
4684 triangle2 = triangle_neighbor(3,triangle)
4686 if ( triangle2 < 0 .or. triangle < triangle2 )
then
4687 adj_col(n1) = adj_col(n1) + 1
4688 adj_col(n3) = adj_col(n3) + 1
4689 adj_col(n1) = adj_col(n1) + 1
4690 adj_col(n6) = adj_col(n6) + 1
4691 adj_col(n3) = adj_col(n3) + 1
4692 adj_col(n6) = adj_col(n6) + 1
4700 adj_col(2:node_num+1) = adj_col(1:node_num)
4703 do i = 2, node_num + 1
4704 adj_col(i) = adj_col(i-1) + adj_col(i)
4707 adj_num = adj_col(node_num+1) - 1
4712 triangle_node, triangle_neighbor, adj_num, adj_col, adj )
4873 integer ( kind = 4 ) adj_num
4874 integer ( kind = 4 ) node_num
4875 integer ( kind = 4 ) triangle_num
4876 integer ( kind = 4 ),
parameter :: triangle_order = 6
4878 integer ( kind = 4 ) adj(adj_num)
4879 integer ( kind = 4 ) adj_copy(node_num)
4880 integer ( kind = 4 ) adj_col(node_num+1)
4881 integer ( kind = 4 ) k1
4882 integer ( kind = 4 ) k2
4883 integer ( kind = 4 ) n1
4884 integer ( kind = 4 ) n2
4885 integer ( kind = 4 ) n3
4886 integer ( kind = 4 ) n4
4887 integer ( kind = 4 ) n5
4888 integer ( kind = 4 ) n6
4889 integer ( kind = 4 ) node
4890 integer ( kind = 4 ) triangle
4891 integer ( kind = 4 ) triangle2
4892 integer ( kind = 4 ) triangle_neighbor(3,triangle_num)
4893 integer ( kind = 4 ) triangle_node(triangle_order,triangle_num)
4896 adj_copy(1:node_num) = adj_col(1:node_num)
4900 do node = 1, node_num
4901 adj(adj_copy(node)) = node
4902 adj_copy(node) = adj_copy(node) + 1
4907 do triangle = 1, triangle_num
4909 n1 = triangle_node(1,triangle)
4910 n2 = triangle_node(2,triangle)
4911 n3 = triangle_node(3,triangle)
4912 n4 = triangle_node(4,triangle)
4913 n5 = triangle_node(5,triangle)
4914 n6 = triangle_node(6,triangle)
4924 adj(adj_copy(n3)) = n4
4925 adj_copy(n3) = adj_copy(n3) + 1
4926 adj(adj_copy(n4)) = n3
4927 adj_copy(n4) = adj_copy(n4) + 1
4929 adj(adj_copy(n1)) = n5
4930 adj_copy(n1) = adj_copy(n1) + 1
4931 adj(adj_copy(n5)) = n1
4932 adj_copy(n5) = adj_copy(n5) + 1
4934 adj(adj_copy(n4)) = n5
4935 adj_copy(n4) = adj_copy(n4) + 1
4936 adj(adj_copy(n5)) = n4
4937 adj_copy(n5) = adj_copy(n5) + 1
4939 adj(adj_copy(n2)) = n6
4940 adj_copy(n2) = adj_copy(n2) + 1
4941 adj(adj_copy(n6)) = n2
4942 adj_copy(n6) = adj_copy(n6) + 1
4944 adj(adj_copy(n4)) = n6
4945 adj_copy(n4) = adj_copy(n4) + 1
4946 adj(adj_copy(n6)) = n4
4947 adj_copy(n6) = adj_copy(n6) + 1
4949 adj(adj_copy(n5)) = n6
4950 adj_copy(n5) = adj_copy(n5) + 1
4951 adj(adj_copy(n6)) = n5
4952 adj_copy(n6) = adj_copy(n6) + 1
4964 triangle2 = triangle_neighbor(1,triangle)
4966 if ( triangle2 < 0 .or. triangle < triangle2 )
then
4967 adj(adj_copy(n1)) = n2
4968 adj_copy(n1) = adj_copy(n1) + 1
4969 adj(adj_copy(n2)) = n1
4970 adj_copy(n2) = adj_copy(n2) + 1
4971 adj(adj_copy(n1)) = n4
4972 adj_copy(n1) = adj_copy(n1) + 1
4973 adj(adj_copy(n4)) = n1
4974 adj_copy(n4) = adj_copy(n4) + 1
4975 adj(adj_copy(n2)) = n4
4976 adj_copy(n2) = adj_copy(n2) + 1
4977 adj(adj_copy(n4)) = n2
4978 adj_copy(n4) = adj_copy(n4) + 1
4986 triangle2 = triangle_neighbor(2,triangle)
4988 if ( triangle2 < 0 .or. triangle < triangle2 )
then
4989 adj(adj_copy(n2)) = n3
4990 adj_copy(n2) = adj_copy(n2) + 1
4991 adj(adj_copy(n3)) = n2
4992 adj_copy(n3) = adj_copy(n3) + 1
4993 adj(adj_copy(n2)) = n5
4994 adj_copy(n2) = adj_copy(n2) + 1
4995 adj(adj_copy(n5)) = n2
4996 adj_copy(n5) = adj_copy(n5) + 1
4997 adj(adj_copy(n3)) = n5
4998 adj_copy(n3) = adj_copy(n3) + 1
4999 adj(adj_copy(n5)) = n3
5000 adj_copy(n5) = adj_copy(n5) + 1
5008 triangle2 = triangle_neighbor(3,triangle)
5010 if ( triangle2 < 0 .or. triangle < triangle2 )
then
5011 adj(adj_copy(n1)) = n3
5012 adj_copy(n1) = adj_copy(n1) + 1
5013 adj(adj_copy(n3)) = n1
5014 adj_copy(n3) = adj_copy(n3) + 1
5015 adj(adj_copy(n1)) = n6
5016 adj_copy(n1) = adj_copy(n1) + 1
5017 adj(adj_copy(n6)) = n1
5018 adj_copy(n6) = adj_copy(n6) + 1
5019 adj(adj_copy(n3)) = n6
5020 adj_copy(n3) = adj_copy(n3) + 1
5021 adj(adj_copy(n6)) = n3
5022 adj_copy(n6) = adj_copy(n6) + 1
5029 do node = 1, node_num
5031 k2 = adj_col(node+1)-1
5038 triangle_node, triangle_neighbor )
5100 integer ( kind = 4 ),
parameter :: dim_num = 2
5101 integer ( kind = 4 ) node_num
5102 integer ( kind = 4 ) triangle_num
5103 integer ( kind = 4 ),
parameter :: triangle_order = 6
5105 real ( kind = 8 ) node_xy(dim_num,node_num)
5106 integer ( kind = 4 ) triangle_neighbor(3,triangle_num)
5107 integer ( kind = 4 ) triangle_node(triangle_order,triangle_num)
5109 node_xy = reshape( (/ &
5135 /), (/ dim_num, node_num /) )
5137 triangle_node(1:triangle_order,1:triangle_num) = reshape( (/ &
5138 1, 3, 11, 2, 7, 6, &
5139 13, 11, 3, 12, 7, 8, &
5140 3, 5, 13, 4, 9, 8, &
5141 15, 13, 5, 14, 9, 10, &
5142 11, 13, 21, 12, 17, 16, &
5143 23, 21, 13, 22, 17, 18, &
5144 13, 15, 23, 14, 19, 18, &
5145 25, 23, 15, 24, 19, 20 /), (/ triangle_order, triangle_num /) )
5147 triangle_neighbor(1:3,1:triangle_num) = reshape( (/ &
5155 -1, 7, -1 /), (/ 3, triangle_num /) )
5204 integer ( kind = 4 ) hole_num
5205 integer ( kind = 4 ) node_num
5206 integer ( kind = 4 ) triangle_num
subroutine i4col_sort_a(m, n, a)
subroutine sort_heap_external(n, indx, i, j, isgn)
subroutine triangulation_neighbor_triangles(triangle_order, triangle_num, triangle_node, triangle_neighbor)
subroutine i4mat_print_some(m, n, a, ilo, jlo, ihi, jhi, title)
subroutine perm_check(n, p, ierror)
subroutine genrcm(node_num, adj_num, adj_row, adj, perm)
subroutine root_find(root, adj_num, adj_row, adj, mask, level_num, level_row, level, node_num)
subroutine perm_uniform(n, seed, p)
subroutine r82vec_permute(n, a, p)
subroutine r8mat_transpose_print_some(m, n, a, ilo, jlo, ihi, jhi, title)
subroutine adj_print(node_num, adj_num, adj_row, adj, title)
subroutine i4col_compare(m, n, a, i, j, isgn)
subroutine rcm(root, adj_num, adj_row, adj, mask, perm, iccsze, node_num)
subroutine triangulation_order3_adj_set(node_num, triangle_num, triangle_node, triangle_neighbor, adj_num, adj_col, adj)
subroutine i4mat_transpose_print(m, n, a, title)
logical function adj_contains_ij(node_num, adj_num, adj_row, adj, i, j)
subroutine adj_insert_ij(node_num, adj_max, adj_num, adj_row, adj, i, j)
subroutine i4vec_heap_d(n, a)
subroutine level_set(root, adj_num, adj_row, adj, mask, level_num, level_row, level, node_num)
subroutine adj_set(node_num, adj_max, adj_num, adj_row, adj, irow, jcol)
subroutine adj_print_some(node_num, node_lo, node_hi, adj_num, adj_row, adj, title)
subroutine i4vec_print(n, a, title)
subroutine adj_perm_show(node_num, adj_num, adj_row, adj, perm, perm_inv)
subroutine i4vec_sort_heap_a(n, a)
subroutine i4vec_indicator(n, a)
subroutine graph_01_size(node_num, adj_num)
subroutine triangulation_order3_example2(node_num, triangle_num, node_xy, triangle_node, triangle_neighbor)
subroutine adj_show(node_num, adj_num, adj_row, adj)
subroutine i4col_swap(m, n, a, i, j)
integer(kind=4) function adj_perm_bandwidth(node_num, adj_num, adj_row, adj, perm, perm_inv)
subroutine i4vec_reverse(n, a)
subroutine level_set_print(node_num, level_num, level_row, level)
subroutine triangulation_order3_adj_count(node_num, triangle_num, triangle_node, triangle_neighbor, adj_num, adj_col)
integer(kind=4) function adj_bandwidth(node_num, adj_num, adj_row, adj)
subroutine graph_01_adj(node_num, adj_num, adj_row, adj)
subroutine r8mat_print_some(m, n, a, ilo, jlo, ihi, jhi, title)
subroutine triangulation_order3_example2_size(node_num, triangle_num, hole_num)
subroutine perm_inverse3(n, perm, perm_inv)
subroutine triangulation_order6_example2_size(node_num, triangle_num, hole_num)
integer(kind=4) function i4_uniform_ab(a, b, seed)
subroutine triangulation_order6_adj_set(node_num, triangle_num, triangle_node, triangle_neighbor, adj_num, adj_col, adj)
subroutine triangulation_order6_example2(node_num, triangle_num, node_xy, triangle_node, triangle_neighbor)
subroutine triangulation_order6_adj_count(node_num, triangle_num, triangle_node, triangle_neighbor, adj_num, adj_col)
subroutine degree(root, adj_num, adj_row, adj, mask, deg, iccsze, ls, node_num)
subroutine i4mat_transpose_print_some(m, n, a, ilo, jlo, ihi, jhi, title)