@@ -58,6 +58,11 @@ LinearAlgebra.fill!(A::PseudoBandedMatrix, v) = fill!(A.data,v)
5858 @test B * Eye (5 ) == B
5959 @test muladd! (2.0 , Eye (5 ), B, 0.0 , zeros (5 ,5 )) == 2 B
6060 @test muladd! (2.0 , B, Eye (5 ), 0.0 , zeros (5 ,5 )) == 2 B
61+
62+ E = Eye (4 )
63+ @test (@inferred E[band (0 )]) == Ones (4 )
64+ @test (@inferred E[band (1 )]) == Zeros (3 )
65+ @test (@inferred E[band (- 1 )]) == Zeros (3 )
6166 end
6267
6368 @testset " Diagonal" begin
@@ -79,9 +84,9 @@ LinearAlgebra.fill!(A::PseudoBandedMatrix, v) = fill!(A.data,v)
7984 @test A[band (0 )] == [2 ; ones (4 )]
8085
8186 B = Diagonal (Fill (1 ,5 ))
82- @test B[band (0 )] ≡ Fill (1 ,5 )
83- @test B[band (1 )] ≡ B[band (- 1 )] ≡ Fill (0 ,4 )
84- @test B[band (2 )] ≡ B[band (- 2 )] ≡ Fill (0 ,3 )
87+ @test ( @inferred B[band (0 )]) == Fill (1 ,5 )
88+ @test ( @inferred B[band (1 )]) == B[band (- 1 )] == Fill (0 ,4 )
89+ @test ( @inferred B[band (2 )]) == B[band (- 2 )] == Fill (0 ,3 )
8590 end
8691
8792 @testset " SymTridiagonal" begin
@@ -93,32 +98,32 @@ LinearAlgebra.fill!(A::PseudoBandedMatrix, v) = fill!(A.data,v)
9398 @test A[1 ,1 ] == 2
9499
95100 B = SymTridiagonal (Fill (1 ,5 ), Fill (2 ,4 ))
96- @test B[band (0 )] ≡ Fill (1 ,5 )
97- @test B[band (1 )] ≡ B[band (- 1 )] ≡ Fill (2 ,4 )
98- @test B[band (2 )] ≡ B[band (- 2 )] ≡ Fill (0 ,3 )
101+ @test ( @inferred B[band (0 )]) == Fill (1 ,5 )
102+ @test ( @inferred B[band (1 )]) == B[band (- 1 )] == Fill (2 ,4 )
103+ @test ( @inferred B[band (2 )]) == B[band (- 2 )] == Fill (0 ,3 )
99104 end
100105
101106 @testset " Tridiagonal" begin
102107 B = Tridiagonal (Fill (1 ,4 ), Fill (2 ,5 ), Fill (3 ,4 ))
103- @test B[band (0 )] ≡ Fill (2 ,5 )
104- @test B[band (1 )] ≡ Fill (3 ,4 )
105- @test B[band (- 1 )] ≡ Fill (1 ,4 )
106- @test B[band (2 )] ≡ B[band (- 2 )] ≡ Fill (0 ,3 )
108+ @test ( @inferred B[band (0 )]) == Fill (2 ,5 )
109+ @test ( @inferred B[band (1 )]) == Fill (3 ,4 )
110+ @test ( @inferred B[band (- 1 )]) == Fill (1 ,4 )
111+ @test B[band (2 )] == B[band (- 2 )] == Fill (0 ,3 )
107112 end
108113
109114 @testset " Bidiagonal" begin
110115 L = Bidiagonal (Fill (2 ,5 ), Fill (1 ,4 ), :L )
111- @test L[band (0 )] ≡ Fill (2 ,5 )
112- @test L[band (1 )] ≡ Fill (0 ,4 )
113- @test L[band (- 1 )] ≡ Fill (1 ,4 )
114- @test L[band (2 )] ≡ L[band (- 2 )] ≡ Fill (0 ,3 )
116+ @test ( @inferred L[band (0 )]) == Fill (2 ,5 )
117+ @test ( @inferred L[band (1 )]) == Fill (0 ,4 )
118+ @test ( @inferred L[band (- 1 )]) == Fill (1 ,4 )
119+ @test ( @inferred L[band (2 )]) == L[band (- 2 )] == Fill (0 ,3 )
115120 @test BandedMatrix (L) == L
116121
117122 U = Bidiagonal (Fill (2 ,5 ), Fill (1 ,4 ), :U )
118- @test U[band (0 )] ≡ Fill (2 ,5 )
119- @test U[band (1 )] ≡ Fill (1 ,4 )
120- @test U[band (- 1 )] ≡ Fill (0 ,4 )
121- @test U[band (2 )] ≡ U[band (- 2 )] ≡ Fill (0 ,3 )
123+ @test ( @inferred U[band (0 )]) == Fill (2 ,5 )
124+ @test ( @inferred U[band (1 )]) == Fill (1 ,4 )
125+ @test ( @inferred U[band (- 1 )]) == Fill (0 ,4 )
126+ @test ( @inferred U[band (2 )]) == U[band (- 2 )] == Fill (0 ,3 )
122127 @test BandedMatrix (U) == U
123128 end
124129
0 commit comments