Skip to content

Commit 0e9adcd

Browse files
committed
Record useless BipartiteGraph
1 parent 3c1350b commit 0e9adcd

2 files changed

Lines changed: 14 additions & 18 deletions

File tree

src/result.jl

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,7 @@ struct ColumnColoringResult{M<:AbstractMatrix,G<:BipartiteGraph} <:
110110
"color groups for columns or rows (depending on `partition`)"
111111
group::Vector{Vector{Int}}
112112
"flattened indices mapping the compressed matrix `B` to the uncompressed matrix `A` when `A isa SparseMatrixCSC`. They satisfy `nonzeros(A)[k] = vec(B)[compressed_indices[k]]`"
113-
compressed_indices::C
114-
end
115-
116-
function ColumnColoringResult(A::AbstractMatrix, color::Vector{Int})
117-
group = group_by_color(color)
118-
return ColumnColoringResult(A, color, group, nothing)
113+
compressed_indices::Vector{Int}
119114
end
120115

121116
function ColumnColoringResult(A::AbstractMatrix, bg::BipartiteGraph, color::Vector{Int})
@@ -156,12 +151,7 @@ struct RowColoringResult{M<:AbstractMatrix,G<:BipartiteGraph} <:
156151
bg::G
157152
color::Vector{Int}
158153
group::Vector{Vector{Int}}
159-
compressed_indices::C
160-
end
161-
162-
function RowColoringResult(A::AbstractMatrix, color::Vector{Int})
163-
group = group_by_color(color)
164-
return RowColoringResult(A, nothing, color, group, nothing)
154+
compressed_indices::Vector{Int}
165155
end
166156

167157
function RowColoringResult(A::AbstractMatrix, bg::BipartiteGraph, color::Vector{Int})

src/structured.jl

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ function coloring(
2424
kwargs...,
2525
)
2626
color = fill(1, size(A, 2))
27-
return ColumnColoringResult(A, color)
27+
bg = BipartiteGraph(A)
28+
return ColumnColoringResult(A, bg, color)
2829
end
2930

3031
function coloring(
@@ -34,7 +35,8 @@ function coloring(
3435
kwargs...,
3536
)
3637
color = fill(1, size(A, 1))
37-
return RowColoringResult(A, color)
38+
bg = BipartiteGraph(A)
39+
return RowColoringResult(A, bg, color)
3840
end
3941

4042
function decompress!(
@@ -66,7 +68,8 @@ function coloring(
6668
kwargs...,
6769
)
6870
color = cycle_until(1:2, size(A, 2))
69-
return ColumnColoringResult(A, color)
71+
bg = BipartiteGraph(A)
72+
return ColumnColoringResult(A, bg, color)
7073
end
7174

7275
function coloring(
@@ -76,7 +79,8 @@ function coloring(
7679
kwargs...,
7780
)
7881
color = cycle_until(1:2, size(A, 1))
79-
return RowColoringResult(A, color)
82+
bg = BipartiteGraph(A)
83+
return RowColoringResult(A, bg, color)
8084
end
8185

8286
function decompress!(
@@ -120,7 +124,8 @@ function coloring(
120124
kwargs...,
121125
)
122126
color = cycle_until(1:3, size(A, 2))
123-
return ColumnColoringResult(A, color)
127+
bg = BipartiteGraph(A)
128+
return ColumnColoringResult(A, bg, color)
124129
end
125130

126131
function coloring(
@@ -130,7 +135,8 @@ function coloring(
130135
kwargs...,
131136
)
132137
color = cycle_until(1:3, size(A, 1))
133-
return RowColoringResult(A, color)
138+
bg = BipartiteGraph(A)
139+
return RowColoringResult(A, bg, color)
134140
end
135141

136142
function decompress!(

0 commit comments

Comments
 (0)