Skip to content

Commit

Permalink
Limit factorize to >= v1.8
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffFessler committed Jan 2, 2023
1 parent 65608c1 commit 10176ab
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/strang.jl
Expand Up @@ -72,6 +72,7 @@ SparseArrays: spdiagm
U = spdiagm(0 => (2:n+1) ./ (1:n), 1 => -ones(n-1))
=#

if VERSION >= v"1.8"
#=
Strang is a special case of SymTridiagonal,
and the default factorization of that class is LDLt
Expand All @@ -87,3 +88,4 @@ function LinearAlgebra.factorize(A::Strang)
S = SymTridiagonal(dv, ev)
return LDLt(S)
end
end
7 changes: 7 additions & 0 deletions test/strang.jl
Expand Up @@ -30,7 +30,12 @@ using Test: @test, @testset, @test_throws, @inferred
@test issymmetric(A)
@test ishermitian(A)
@test isposdef(A)
end


if VERSION >= v"1.8"

@testset "strang-factor" begin
# factorize:
n = 5
A = Strang(5)
Expand All @@ -43,3 +48,5 @@ using Test: @test, @testset, @test_throws, @inferred
@test F.L G.L
@test F.D G.D
end

end

0 comments on commit 10176ab

Please sign in to comment.