Skip to content

Commit 4072996

Browse files
authored
Update result type in triangular-vector multiplication (#185)
1 parent 4ad9b38 commit 4072996

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

test/test_triblockbanded.jl

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,31 +20,35 @@ import BlockArrays: BlockedUnitRange, blockisequal
2020
U = UpperTriangular(A)
2121
@test MemoryLayout(typeof(U)) == TriangularLayout{'U','N',BandedBlockBandedColumnMajor}()
2222
b = randn(size(U,1))
23-
@test U*b isa Vector{Float64}
24-
@test lmul(U,b) == U*b
25-
@test U*b Matrix(U)*b
23+
Ub = U*b
24+
@test Ub isa AbstractVector{Float64}
25+
@test lmul(U,b) == Ub
26+
@test Ub Matrix(U)*b
2627

2728
U = UnitUpperTriangular(A)
2829
@test MemoryLayout(typeof(U)) == TriangularLayout{'U','U',BandedBlockBandedColumnMajor}()
2930
b = randn(size(U,1))
30-
@test U*b isa Vector{Float64}
31-
@test lmul(U,b) == U*b
32-
@test U*b Matrix(U)*b
31+
Ub = U*b
32+
@test Ub isa AbstractVector{Float64}
33+
@test lmul(U,b) == Ub
34+
@test Ub Matrix(U)*b
3335

3436
L = LowerTriangular(A)
3537
@test MemoryLayout(typeof(L)) == TriangularLayout{'L','N',BandedBlockBandedColumnMajor}()
3638
b = randn(size(U,1))
37-
@test L*b isa Vector{Float64}
38-
@test lmul(L,b) == L*b
39-
@test L*b Matrix(L)*b
39+
Lb = L*b
40+
@test Lb isa AbstractVector{Float64}
41+
@test lmul(L,b) == Lb
42+
@test Lb Matrix(L)*b
4043

4144

4245
L = UnitLowerTriangular(A)
4346
@test MemoryLayout(typeof(L)) == TriangularLayout{'L','U',BandedBlockBandedColumnMajor}()
4447
b = randn(size(L,1))
45-
@test L*b isa Vector{Float64}
46-
@test lmul(L,b) == L*b
47-
@test L*b Matrix(L)*b
48+
Lb = L*b
49+
@test Lb isa AbstractVector{Float64}
50+
@test lmul(L,b) == Lb
51+
@test Lb Matrix(L)*b
4852
end
4953

5054
@testset "Block by BlockIndex" begin

0 commit comments

Comments
 (0)