Skip to content

Commit 7078229

Browse files
committed
neighbour -> directed strong couplings in comments
1 parent f40ac89 commit 7078229

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/splitting.jl

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,17 @@ function RS_CF_splitting(S::SparseMatrixCSC, T::SparseMatrixCSC)
3838
index_to_node = zeros(Int,n)
3939
node_to_index = zeros(Int,n)
4040

41-
# compute lambdas - number of neighbors
4241
for i = 1:n
43-
lambda[i] = Sp[i+1] - Sp[i]
44-
# number of nodes with a certain neighbor count, counting the node itself
42+
# compute lambda[i] - the number of nodes strongly coupled to node i
43+
lambda[i] = Sp[i+1] - Sp[i]
4544
interval_count[lambda[i] + 1] += 1
4645
end
4746

4847
# initial interval_ptr
4948
@views accumulate!(+, interval_ptr[2:end], interval_count[1:end-1])
5049

51-
# sort the nodes by their number of neighbours:
52-
# `index_to_node[idx]` is the node with `idx`th least number of neighbours
50+
# sort the nodes by the number of nodes strongly coupled to them:
51+
# `index_to_node[idx]` is the node with `idx`th least number of nodes coupled to it
5352
# `node_to_index[idx]` is the position of the `idx`th node in `index_to_node`
5453
# linear time and allocation-free equivalent to:
5554
# sortperm!(index_to_node, lambda)
@@ -64,7 +63,7 @@ function RS_CF_splitting(S::SparseMatrixCSC, T::SparseMatrixCSC)
6463
end
6564
splitting = fill(U_NODE, n)
6665

67-
# all nodes with no neighbors (but themselves) become F nodes
66+
# all nodes which no other nodes are strongly coupled to become F nodes
6867
for i = 1:n
6968
if lambda[i] == 0
7069
splitting[i] = F_NODE
@@ -75,7 +74,7 @@ function RS_CF_splitting(S::SparseMatrixCSC, T::SparseMatrixCSC)
7574
# highest lambda[i].
7675

7776
# index_to_node[interval_ptr[i]+1 : interval_ptr[i+1]] includes the set of U nodes with
78-
# i-1 neighbors, and other "inactive" F and C nodes.
77+
# i-1 nodes strongly coupled to them, and other "inactive" F and C nodes.
7978

8079
# C nodes are always in index_to_node[top_index:n]. So at the end of the last
8180
# non-empty interval_ptr[i]+1 : interval_ptr[i+1] will be all the C nodes together
@@ -99,7 +98,7 @@ function RS_CF_splitting(S::SparseMatrixCSC, T::SparseMatrixCSC)
9998
if splitting[row] == U_NODE
10099
splitting[row] = F_NODE
101100

102-
# increment lambda for all U neighbours of the new F points
101+
# increment lambda for all U nodes that node `row` is strongly coupled to
103102
for k in nzrange(T, row)
104103
rowk = T.rowval[k]
105104

@@ -129,7 +128,7 @@ function RS_CF_splitting(S::SparseMatrixCSC, T::SparseMatrixCSC)
129128
end
130129
end
131130

132-
# decrement lambda for all U neighbours of the new C point
131+
# decrement lambda for all U nodes that node i is strongly coupled to
133132
for j in nzrange(T, i)
134133
row = T.rowval[j]
135134
if splitting[row] == U_NODE

0 commit comments

Comments
 (0)