From 0779da5cf2fd6b0978bf26d1a76bdfc3a49085af Mon Sep 17 00:00:00 2001 From: Alexis Montoison <35051714+amontoison@users.noreply.github.com> Date: Thu, 3 Apr 2025 18:40:45 -0500 Subject: [PATCH] Update bidirectional_pattern Small modification to make the function easier to understand. Explained like this in the bicoloring paper. --- src/graph.jl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/graph.jl b/src/graph.jl index 7f3863e3..3a6ed5cd 100644 --- a/src/graph.jl +++ b/src/graph.jl @@ -148,7 +148,7 @@ function bidirectional_pattern(S::SparsityPatternCSC{T}; symmetric_pattern::Bool counter = 1 for col in (n + 1):p nnz_col = colptr[col] - colptr[col] = counter + colptr[col] = nnzS + counter counter += nnz_col end @@ -156,15 +156,15 @@ function bidirectional_pattern(S::SparsityPatternCSC{T}; symmetric_pattern::Bool for index in S.colptr[j]:(S.colptr[j + 1] - 1) i = S.rowval[index] pos = colptr[n + i] - rowval[nnzS + pos] = j - edge_to_index[nnzS + pos] = edge_to_index[index] + rowval[pos] = j + edge_to_index[pos] = edge_to_index[index] colptr[n + i] += 1 end end colptr[p + 1] = nnzS + counter for col in p:-1:(n + 2) - colptr[col] = nnzS + colptr[col - 1] + colptr[col] = colptr[col - 1] end colptr[n + 1] = nnzS + 1 end