Skip to content

Commit

Permalink
Missing diag tests for block SymTriDiag (#34926)
Browse files Browse the repository at this point in the history
  • Loading branch information
kshyatt committed Feb 29, 2020
1 parent 7533d04 commit e9b7060
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions stdlib/LinearAlgebra/test/tridiag.jl
Original file line number Diff line number Diff line change
Expand Up @@ -400,13 +400,18 @@ end

@testset "SymTridiagonal block matrix" begin
M = [1 2; 2 4]
A = SymTridiagonal(fill(M, 3), fill(M, 2))
n = 5
A = SymTridiagonal(fill(M, n), fill(M, n-1))
@test @inferred A[1,1] == Symmetric(M)
@test @inferred A[1,2] == M
@test @inferred A[2,1] == transpose(M)
@test @inferred diag(A, 1) == fill(M, 2)
@test @inferred diag(A, 0) == fill(Symmetric(M), 3)
@test @inferred diag(A, -1) == fill(transpose(M), 2)
@test @inferred diag(A, 1) == fill(M, n-1)
@test @inferred diag(A, 0) == fill(Symmetric(M), n)
@test @inferred diag(A, -1) == fill(transpose(M), n-1)
@test_throws ArgumentError diag(A, -2)
@test_throws ArgumentError diag(A, 2)
@test_throws ArgumentError diag(A, n+1)
@test_throws ArgumentError diag(A, -n-1)
end

@testset "Issue 12068" begin
Expand Down

0 comments on commit e9b7060

Please sign in to comment.