Skip to content

Commit 4c4a5ad

Browse files
authored
Drop old version checking (#494)
* Drop old version checking * fix overloads * Update downstream.yml * increase coverage
1 parent 6ccbdd8 commit 4c4a5ad

File tree

6 files changed

+32
-32
lines changed

6 files changed

+32
-32
lines changed

src/banded/BandedLU.jl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@ Base.iterate(S::BandedLU, ::Val{:U}) = (S.U, Val(:p))
3232
Base.iterate(S::BandedLU, ::Val{:p}) = (S.p, Val(:done))
3333
Base.iterate(S::BandedLU, ::Val{:done}) = nothing
3434

35-
if !(isdefined(LinearAlgebra, :AdjointFactorization)) # VERSION < v"1.10-"
36-
adjoint(F::BandedLU) = Adjoint(F)
37-
end
3835
transpose(F::BandedLU) = TransposeFact(F)
3936

4037
lu(S::BandedLU) = S

src/generic/AbstractBandedMatrix.jl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -332,10 +332,9 @@ end
332332
####
333333

334334
bandwidths(A::AdjOrTrans{T,S}) where {T,S} = reverse(bandwidths(parent(A)))
335-
if VERSION >= v"1.9"
336-
copy(A::Adjoint{T,<:AbstractBandedMatrix}) where T = copy(parent(A))'
337-
copy(A::Transpose{T,<:AbstractBandedMatrix}) where T = transpose(copy(parent(A)))
338-
end
335+
copy(A::Adjoint{T,<:AbstractBandedMatrix}) where T = copy(parent(A))'
336+
copy(A::Transpose{T,<:AbstractBandedMatrix}) where T = transpose(copy(parent(A)))
337+
339338

340339
function sum!(ret::AbstractArray, A::AbstractBandedMatrix)
341340
#Behaves similarly to Base.sum!

src/symbanded/SplitCholesky.jl

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,9 @@ function splitcholesky!(::HermitianLayout{<:BandedColumnMajor},
5454
SplitCholesky(A, A.uplo)
5555
end
5656

57-
if !(isdefined(LinearAlgebra, :AdjointFactorization)) # VERSION < v"1.10-"
58-
adjoint(S::SplitCholesky) = Adjoint(S)
59-
else
60-
transpose(S::SplitCholesky{<:Real}) = S'
61-
transpose(::SplitCholesky) =
62-
throw(ArgumentError("transpose of SplitCholesky decomposition is not supported, consider using adjoint"))
63-
end
57+
transpose(S::SplitCholesky{<:Real}) = S'
58+
transpose(::SplitCholesky) =
59+
throw(ArgumentError("transpose of SplitCholesky decomposition is not supported, consider using adjoint"))
6460
6561
function lmul!(S::SplitCholesky{T,<:HermOrSym{T,M}}, B::AbstractVecOrMat{T}) where {T<:Real,M<:BandedMatrix{T}}
6662
require_one_based_indexing(B)

test/test_banded.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ include("mymatrix.jl")
7171
@test Matrix(sparse(A)) Matrix(A)
7272

7373
@test Matrix(A') ≈ Matrix(A)'
74-
@test Matrix(transpose(A)) transpose(Matrix(A))
74+
@test Matrix(transpose(A)) copy(transpose(A)) transpose(Matrix(A))
7575
@test Matrix((A+im*A)') (Matrix(A)+im*Matrix(A))'
7676
@test Matrix(transpose(A+im*A)) transpose(Matrix(A)+im*Matrix(A))
7777

test/test_broadcasting.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ Random.seed!(0)
4242
@test 1 .+ A isa BandedMatrix
4343
@test (1 .+ A) == 1 .+ Matrix(A)
4444
@test 1 .\ A == 1 .\ Matrix(A)
45-
4645
@test 1 .\ A isa BandedMatrix
4746
@test bandwidths(1 .\ A) == bandwidths(A)
4847

test/test_symbanded.jl

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -348,14 +348,13 @@ end
348348
B = sbmatrix(W, T, Ub, wb, n)
349349
AM, BM = Matrix.((A,B))
350350
@test eigvals(A, B) ≈ eigvals(AM, BM)
351-
if VERSION >= v"1.9"
352-
Λ, V = eigen(A, B)
353-
VM = Matrix(V)
354-
Λ2, V2 = eigen(AM, BM)
355-
@test Λ ≈ Λ2
356-
@test VM' * AM * VM V2' * AM * V2
357-
@test VM' * AM * VM VM' * BM * VM * Diagonal(Λ)
358-
end
351+
352+
Λ, V = eigen(A, B)
353+
VM = Matrix(V)
354+
Λ2, V2 = eigen(AM, BM)
355+
@test Λ ≈ Λ2
356+
@test VM' * AM * VM V2' * AM * V2
357+
@test VM' * AM * VM VM' * BM * VM * Diagonal(Λ)
359358
end
360359
end
361360
@@ -370,7 +369,7 @@ end
370369
371370
b = rand(T,size(A,1))
372371
@test Ac\b ≈ Matrix(A)\b
373-
VERSION >= v"1.9-" && @test Ac\b ≈ A\b
372+
@test Ac\b ≈ A\b
374373
end
375374
376375
for T in (Float64, BigFloat)
@@ -383,7 +382,7 @@ end
383382
384383
b = rand(T,size(A,1))
385384
@test Ac\b ≈ Matrix(A)\b
386-
VERSION >= v"1.9-" && @test Ac\b ≈ A\b
385+
@test Ac\b ≈ A\b
387386
end
388387
389388
let T = ComplexF64
@@ -396,7 +395,7 @@ end
396395
397396
b = rand(T,size(A,1))
398397
@test Ac\b ≈ Matrix(A)\b
399-
VERSION >= v"1.9-" && @test Ac\b ≈ A\b
398+
@test Ac\b ≈ A\b
400399
end
401400
402401
B = BandedMatrix(1=>Float64[1:4;], 0=>Float64[1:5;], -1=>Float64[1:4;])
@@ -409,11 +408,9 @@ end
409408
B = BandedMatrix(Symmetric(L * L'));
410409
Bv = Symmetric(view(B, :, :))
411410
chol = cholesky(Bv)
412-
if VERSION >= v"1.7"
413-
@test MemoryLayout(chol.U) isa TriangularLayout{'U', 'N', typeof(MemoryLayout(B))}
414-
@test MemoryLayout(chol.L) isa TriangularLayout{'L', 'N', typeof(MemoryLayout(B'))}
415-
@test isbanded(chol.L)
416-
end
411+
@test MemoryLayout(chol.U) isa TriangularLayout{'U', 'N', typeof(MemoryLayout(B))}
412+
@test MemoryLayout(chol.L) isa TriangularLayout{'L', 'N', typeof(MemoryLayout(B'))}
413+
@test isbanded(chol.L)
417414
@test isbanded(chol.U)
418415
cc = LinearAlgebra.cholcopy(Bv)
419416
@test cc isa Symmetric{Float64, typeof(B)}
@@ -464,4 +461,16 @@ end
464461
@test eltype(bandedmatrix) == eltype(matrix)
465462
end
466463
464+
@testset "splitcholesky!" begin
465+
for T in (Float32, Float64, ComplexF32, ComplexF64)
466+
A = Hermitian(brand(T, 20, 20, 2, 4) + 10I)
467+
S = BandedMatrices.splitcholesky!(A)
468+
if T <: Real
469+
@test transpose(S) ≡ S'
470+
else
471+
@test_throws ArgumentError transpose(S)
472+
end
473+
end
474+
end
475+
467476
end # module

0 commit comments

Comments
 (0)