@@ -17,6 +17,8 @@ symtridiagonal=SymTridiagonal(dense)
17
17
banded= BandedMatrix (dense,(1 ,2 ))
18
18
blockbanded1= BlockBandedMatrix (dense,([1 ,2 ,3 ,4 ],[4 ,3 ,2 ,1 ]),(1 ,0 ))
19
19
blockbanded2= BlockBandedMatrix (dense,([4 ,3 ,2 ,1 ],[1 ,2 ,3 ,4 ]),(1 ,1 ))
20
+ bandedblockbanded1= BandedBlockBandedMatrix (dense,([1 ,2 ,3 ,4 ],[4 ,3 ,2 ,1 ]),(1 ,0 ),(1 ,1 ))
21
+ bandedblockbanded2= BandedBlockBandedMatrix (dense,([4 ,3 ,2 ,1 ],[1 ,2 ,3 ,4 ]),(1 ,1 ),(1 ,0 ))
20
22
21
23
@test matrix_colors (dense)== 1 : n
22
24
@test matrix_colors (uptri)== 1 : n
@@ -30,4 +32,29 @@ blockbanded2=BlockBandedMatrix(dense,([4,3,2,1],[1,2,3,4]),(1,1))
30
32
31
33
@test matrix_colors (banded)== [1 ,2 ,3 ,4 ,1 ,2 ,3 ,4 ,1 ,2 ]
32
34
@test matrix_colors (blockbanded1)== [1 ,2 ,3 ,4 ,5 ,6 ,7 ,1 ,2 ,5 ]
33
- @test matrix_colors (blockbanded2)== [1 ,5 ,6 ,7 ,8 ,9 ,1 ,2 ,3 ,4 ]
35
+ @test matrix_colors (blockbanded2)== [1 ,5 ,6 ,7 ,8 ,9 ,1 ,2 ,3 ,4 ]
36
+ @test matrix_colors (bandedblockbanded1)== [1 ,2 ,3 ,1 ,4 ,5 ,6 ,1 ,2 ,4 ]
37
+ @test matrix_colors (bandedblockbanded2)== [1 ,3 ,4 ,5 ,6 ,5 ,1 ,2 ,1 ,2 ]
38
+
39
+ function _testvalidity (A)
40
+ colorvec= matrix_colors (A)
41
+ ncolor= maximum (colorvec)
42
+ for color in 1 : ncolor
43
+ subA= A[:,findall (x-> x== color,colorvec)]
44
+ @test maximum (sum (subA,dims= 2 ))<= 1.0
45
+ end
46
+ end
47
+
48
+ _testvalidity (dense)
49
+ _testvalidity (uptri)
50
+ _testvalidity (lotri)
51
+ _testvalidity (diagonal)
52
+ _testvalidity (bidiagonalU)
53
+ _testvalidity (bidiagonalL)
54
+ _testvalidity (tridiagonal)
55
+ _testvalidity (symtridiagonal)
56
+ _testvalidity (banded)
57
+ _testvalidity (blockbanded1)
58
+ _testvalidity (blockbanded2)
59
+ _testvalidity (bandedblockbanded1)
60
+ _testvalidity (bandedblockbanded2)
0 commit comments