Skip to content

Commit 35d3e89

Browse files
authored
Update bidirectional_pattern (#230)
Small modification to make the function easier to understand. Explained like this in the bicoloring paper.
1 parent 0553284 commit 35d3e89

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/graph.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,23 +148,23 @@ function bidirectional_pattern(S::SparsityPatternCSC{T}; symmetric_pattern::Bool
148148
counter = 1
149149
for col in (n + 1):p
150150
nnz_col = colptr[col]
151-
colptr[col] = counter
151+
colptr[col] = nnzS + counter
152152
counter += nnz_col
153153
end
154154

155155
for j in 1:n
156156
for index in S.colptr[j]:(S.colptr[j + 1] - 1)
157157
i = S.rowval[index]
158158
pos = colptr[n + i]
159-
rowval[nnzS + pos] = j
160-
edge_to_index[nnzS + pos] = edge_to_index[index]
159+
rowval[pos] = j
160+
edge_to_index[pos] = edge_to_index[index]
161161
colptr[n + i] += 1
162162
end
163163
end
164164

165165
colptr[p + 1] = nnzS + counter
166166
for col in p:-1:(n + 2)
167-
colptr[col] = nnzS + colptr[col - 1]
167+
colptr[col] = colptr[col - 1]
168168
end
169169
colptr[n + 1] = nnzS + 1
170170
end

0 commit comments

Comments
 (0)