@@ -11,19 +11,17 @@ rng = StableRNG(63)
1111
1212@testset " Sparse coloring" begin
1313 n = 10
14- A = sprand (rng, n, n, 5 / n)
14+ A = sparse ( Symmetric ( sprand (rng, n, n, 5 / n)) )
1515
1616 # ADTypes
1717 @testset " ADTypes" begin
18- @test_opt target_modules = (SparseMatrixColorings,) column_coloring (
19- A, GreedyColoringAlgorithm ()
20- )
21- @test_opt target_modules = (SparseMatrixColorings,) row_coloring (
22- A, GreedyColoringAlgorithm ()
23- )
24- @test_opt target_modules = (SparseMatrixColorings,) symmetric_coloring (
25- Symmetric (A), GreedyColoringAlgorithm ()
26- )
18+ @test_opt column_coloring (A, GreedyColoringAlgorithm ())
19+ @test_opt row_coloring (A, GreedyColoringAlgorithm ())
20+ @test_opt symmetric_coloring (Symmetric (A), GreedyColoringAlgorithm ())
21+
22+ @inferred column_coloring (A, GreedyColoringAlgorithm ())
23+ @inferred row_coloring (A, GreedyColoringAlgorithm ())
24+ @inferred symmetric_coloring (Symmetric (A), GreedyColoringAlgorithm ())
2725 end
2826
2927 @testset " $structure - $partition - $decompression " for (
@@ -36,7 +34,12 @@ rng = StableRNG(63)
3634 (:nonsymmetric , :bidirectional , :direct ),
3735 (:nonsymmetric , :bidirectional , :substitution ),
3836 ]
39- @test_opt target_modules = (SparseMatrixColorings,) coloring (
37+ @test_opt coloring (
38+ A,
39+ ColoringProblem (; structure, partition),
40+ GreedyColoringAlgorithm (; decompression),
41+ )
42+ @inferred coloring (
4043 A,
4144 ColoringProblem (; structure, partition),
4245 GreedyColoringAlgorithm (; decompression),
5558 (structure, partition, decompression) in
5659 [(:nonsymmetric , :column , :direct ), (:nonsymmetric , :row , :direct )]
5760
58- @test_opt target_modules = (SparseMatrixColorings,) coloring (
61+ @test_opt coloring (
62+ A,
63+ ColoringProblem (; structure, partition),
64+ GreedyColoringAlgorithm (; decompression),
65+ )
66+ @inferred coloring (
5967 A,
6068 ColoringProblem (; structure, partition),
6169 GreedyColoringAlgorithm (; decompression),
8896 Br, Bc = compress (A, result)
8997 @testset " Full decompression" begin
9098 @test_opt compress (A, result)
91- @test_opt decompress (Br, Bc, result) ≈ A0
99+ @test_opt decompress (Br, Bc, result)
92100 @test_opt decompress! (respectful_similar (A), Br, Bc, result)
101+
102+ @inferred compress (A, result)
103+ @inferred decompress (Br, Bc, result)
93104 end
94105 else
95106 B = compress (A, result)
96107 @testset " Full decompression" begin
97108 @test_opt compress (A, result)
98- @test_opt decompress (B, result) ≈ A0
109+ @test_opt decompress (B, result)
99110 @test_opt decompress! (respectful_similar (A), B, result)
111+
112+ @inferred compress (A, result)
113+ @inferred decompress (B, result)
100114 end
101115 @testset " Single-color decompression" begin
102116 if decompression == :direct
145159 )
146160 B = compress (A, result)
147161 @test_opt decompress (B, result)
162+ @inferred decompress (B, result)
148163 end
149164end ;
0 commit comments