Skip to content

Commit a068e90

Browse files
authored
Add tests for Dense/Strided * (Sym)Tridiagonal (#43549)
1 parent 57bd56e commit a068e90

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

stdlib/LinearAlgebra/test/special.jl

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,4 +453,31 @@ end
453453
@test Bl + S Mbl + Ms
454454
end
455455

456+
@testset "Ensure Strided * (Sym)Tridiagonal is Dense" begin
457+
x = rand(3)
458+
y = rand(3)
459+
z = rand(2)
460+
461+
l = rand(12, 12)
462+
# strided but not a Matrix
463+
v = @view l[1:4:end, 1:4:end]
464+
M_v = Matrix(v)
465+
m = rand(3, 3)
466+
467+
S = SymTridiagonal(x, y)
468+
T = Tridiagonal(z, x, z)
469+
M_S = Matrix(S)
470+
M_T = Matrix(T)
471+
472+
@test m * T m * M_T
473+
@test m * S m * M_S
474+
@test v * T M_v * T
475+
@test v * S M_v * S
476+
477+
@test m * T isa Matrix
478+
@test m * S isa Matrix
479+
@test v * T isa Matrix
480+
@test v * S isa Matrix
481+
end
482+
456483
end # module TestSpecial

0 commit comments

Comments
 (0)