|
602 | 602 | @test A90\b90 ≈ inv(A90)*b90 |
603 | 603 | end |
604 | 604 |
|
| 605 | +@testset "opnorms" begin |
| 606 | + T = Tridiagonal([1,2,3], [1,-2,3,-4], [1,2,3]) |
| 607 | + |
| 608 | + @test opnorm(T, 1) == opnorm(Matrix(T), 1) |
| 609 | + @test_skip opnorm(T, 2) ≈ opnorm(Matrix(T), 2) # currently missing |
| 610 | + @test opnorm(T, Inf) == opnorm(Matrix(T), Inf) |
| 611 | + |
| 612 | + S = SymTridiagonal([1,-2,3,-4], [1,2,3]) |
| 613 | + |
| 614 | + @test opnorm(S, 1) == opnorm(Matrix(S), 1) |
| 615 | + @test_skip opnorm(S, 2) ≈ opnorm(Matrix(S), 2) # currently missing |
| 616 | + @test opnorm(S, Inf) == opnorm(Matrix(S), Inf) |
| 617 | + |
| 618 | + T = Tridiagonal(Int[], [-5], Int[]) |
| 619 | + @test opnorm(T, 1) == opnorm(Matrix(T), 1) |
| 620 | + @test_skip opnorm(T, 2) ≈ opnorm(Matrix(T), 2) # currently missing |
| 621 | + @test opnorm(T, Inf) == opnorm(Matrix(T), Inf) |
| 622 | + |
| 623 | + S = SymTridiagonal(T) |
| 624 | + @test opnorm(S, 1) == opnorm(Matrix(S), 1) |
| 625 | + @test_skip opnorm(S, 2) ≈ opnorm(Matrix(S), 2) # currently missing |
| 626 | + @test opnorm(S, Inf) == opnorm(Matrix(S), Inf) |
| 627 | +end |
| 628 | + |
605 | 629 | @testset "singular values of SymTridiag" begin |
606 | 630 | @test svdvals(SymTridiagonal([-4,2,3], [0,0])) ≈ [4,3,2] |
607 | 631 | @test svdvals(SymTridiagonal(collect(0.:10.), zeros(10))) ≈ reverse(0:10) |
|
0 commit comments