Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
SUBROUTINE PROFIL_SLOAN(N,NNN,E2,ADJ,XADJ,OLDPRO,NEWPRO)
************************************************************************
*
* PURPOSE:
* --------
*
* Compute the profiles using both original and new node numbers
*
* INPUT:
* ------
*
* N - Total number of nodes in graph
* NNN - List of new node numbers for graph
* - New node number for node I is given by NNN(I)
* E2 - Twice the number of edges in the graph = XADJ(N+1)-1
* ADJ - Adjacency list for all nodes in graph
* - List of length 2E where E is the number of edges in
* the graph and 2E = XADJ(N+1)-1
* XADJ - Index vector for ADJ
* - Nodes adjacent to node I are found in ADJ(J), where
* J = XADJ(I), XADJ(I)+1, ..., XADJ(I+1)-1
* - Degree of node I given by XADJ(I+1)-XADJ(I)
* OLDPRO - Undefined
* NEWPRO - Undefined
*
* OUTPUT:
* -------
*
* N - Unchanged
* NNN - Unchanged
* E2 - Unchanged
* ADJ - Unchanged
* XADJ - Unchanged
* OLDPRO - Profile with original node numbering
* NEWPRO - Profile with new node numbering
*
* NOTE: Profiles include diagonal terms
* -----
*
* PROGRAMMER: Scott Sloan
* -----------
*
* LAST MODIFIED: 13 August 1991 Scott Sloan
* --------------
*
* COPYRIGHT 1989: Scott Sloan
* --------------- Department of Civil Engineering
* University of Newcastle
* NSW 2308
*
***********************************************************************
INTEGER I,J,N
INTEGER E2
INTEGER JSTOP,JSTRT
INTEGER NEWMIN,NEWPRO,OLDMIN,OLDPRO
INTEGER ADJ(E2),NNN(N)
INTEGER XADJ(N+1)
*
* Set profiles and loop over each node in graph
*
OLDPRO=0
NEWPRO=0
DO 20 I=1,N
JSTRT=XADJ(I)
JSTOP=XADJ(I+1)-1
OLDMIN=I
NEWMIN=NNN(I)
*
* Find lowest numbered neighbour of node I
* (using both old and new node numbers)
*
DO 10 J=JSTRT,JSTOP
OLDMIN=MIN(OLDMIN,ADJ(J))
NEWMIN=MIN(NEWMIN,NNN(ADJ(J)))
10 CONTINUE
*
* Update profiles
*
OLDPRO=OLDPRO+DIM(I,OLDMIN)
NEWPRO=NEWPRO+DIM(NNN(I),NEWMIN)
20 CONTINUE
*
* Add diagonal terms to profiles
*
OLDPRO=OLDPRO+N
NEWPRO=NEWPRO+N
END