Skip to content

Commit ad84d15

Browse files
authored
Bringe coverage to 100% (#88)
1 parent 21b2cad commit ad84d15

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

src/examples.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function what_fig_41()
3737
#! format: on
3838
@assert M == transpose(M)
3939
nonzeros(M) .= 1:length(nonzeros(M))
40-
A = float.(sparse(Symmetric(M)))
40+
A = sparse(Symmetric(M))
4141
color = [
4242
1, # 1. green
4343
2, # 2. red
@@ -77,7 +77,7 @@ function what_fig_61()
7777
#! format: on
7878
@assert M == transpose(M)
7979
nonzeros(M) .= 1:length(nonzeros(M))
80-
A = float.(sparse(Symmetric(M)))
80+
A = sparse(Symmetric(M))
8181
color = [
8282
1, # 1. red
8383
2, # 2. blue
@@ -123,7 +123,7 @@ function efficient_fig_1()
123123
#! format: on
124124
@assert M == transpose(M)
125125
nonzeros(M) .= 1:length(nonzeros(M))
126-
A = float.(sparse(Symmetric(M)))
126+
A = sparse(Symmetric(M))
127127
color = [
128128
1, # 1. red
129129
2, # 2. cyan
@@ -171,7 +171,7 @@ function efficient_fig_4()
171171
#! format: on
172172
@assert M == transpose(M)
173173
nonzeros(M) .= 1:length(nonzeros(M))
174-
A = float.(sparse(Symmetric(M)))
174+
A = sparse(Symmetric(M))
175175
color = [
176176
1, # 1. red
177177
2, # 2. cyan

src/result.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ function LinearSystemColoringResult(
371371
(i < j) && push!(strict_upper_nonzero_inds, (i, j))
372372
end
373373

374-
T = spzeros(Float64, n * C, length(strict_upper_nonzero_inds))
374+
T = spzeros(float(R), n * C, length(strict_upper_nonzero_inds))
375375
for (l, (i, j)) in enumerate(strict_upper_nonzero_inds)
376376
ci = color[i]
377377
cj = color[j]
@@ -382,7 +382,7 @@ function LinearSystemColoringResult(
382382
end
383383
T_factorization = factorize(T)
384384

385-
strict_upper_nonzeros_A = Vector{R}(undef, size(T, 2))
385+
strict_upper_nonzeros_A = Vector{float(R)}(undef, size(T, 2))
386386

387387
return LinearSystemColoringResult(
388388
S, color, group, strict_upper_nonzero_inds, strict_upper_nonzeros_A, T_factorization

test/utils.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function test_coloring_decompression(
1212
) where {structure,partition,decompression}
1313
color_vec = Vector{Int}[]
1414
@testset "$(typeof(A))" for A in matrix_versions(A0)
15-
result = coloring(A, problem, algo; decompression_eltype=eltype(A))
15+
result = coloring(A, problem, algo; decompression_eltype=Float64)
1616
color = if partition == :column
1717
column_colors(result)
1818
elseif partition == :row
@@ -91,9 +91,9 @@ function test_coloring_decompression(
9191

9292
@testset "Linear system decompression" begin
9393
if structure == :symmetric
94-
linresult = LinearSystemColoringResult(sparse(A), color, eltype(A))
95-
@test decompress(B, linresult) A0
96-
@test decompress!(respectful_similar(A), B, linresult) A0
94+
linresult = LinearSystemColoringResult(sparse(A), color, Float64)
95+
@test decompress(float.(B), linresult) A0
96+
@test decompress!(respectful_similar(float.(A)), float.(B), linresult) A0
9797
end
9898
end
9999
end

0 commit comments

Comments
 (0)