Skip to content

Commit

Permalink
test addition of (symmetric) tridiagonal matrices and I; closes Julia…
Browse files Browse the repository at this point in the history
  • Loading branch information
ranocha authored and oxinabox committed Apr 8, 2020
1 parent 7bbdeb3 commit 4abc4fa
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions stdlib/LinearAlgebra/test/tridiag.jl
Original file line number Diff line number Diff line change
Expand Up @@ -481,4 +481,14 @@ end
@test sum(SymTridiagonal([1,2,3], [1,2])) == 12
end

@testset "Issue #28994 (sum of Tridigonal and UniformScaling)" begin
dl = [1., 1.]
d = [-2., -2., -2.]
T = Tridiagonal(dl, d, dl)
S = SymTridiagonal(T)

@test diag(T + 2I) == zero(d)
@test diag(S + 2I) == zero(d)
end

end # module TestTridiagonal

0 comments on commit 4abc4fa

Please sign in to comment.