Skip to content

Commit bc4293e

Browse files
committed
remove version < 1.6 checks
1 parent 524dc76 commit bc4293e

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

src/projection.jl

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,6 @@ end
472472

473473
# Triangular
474474
for UL in (:UpperTriangular, :LowerTriangular, :UpperHessenberg)
475-
VERSION < v"1.4" && UL == :UpperHessenberg && continue # not defined in 1.0
476475
@eval begin
477476
ProjectTo(x::$UL) = ProjectTo{$UL}(; data=ProjectTo(parent(x)))
478477
(project::ProjectTo{$UL})(dx::AbstractArray) = $UL(project.data(dx))
@@ -499,10 +498,10 @@ end
499498
# Subspaces which aren't subtypes, like Diagonal inside Symmetric above:
500499
(project::ProjectTo{UpperTriangular})(dx::Diagonal) = project.data(dx)
501500
(project::ProjectTo{LowerTriangular})(dx::Diagonal) = project.data(dx)
502-
if VERSION >= v"1.4"
503-
(project::ProjectTo{UpperHessenberg})(dx::Diagonal) = project.data(dx)
504-
(project::ProjectTo{UpperHessenberg})(dx::UpperTriangular) = project.data(dx)
505-
end
501+
502+
(project::ProjectTo{UpperHessenberg})(dx::Diagonal) = project.data(dx)
503+
(project::ProjectTo{UpperHessenberg})(dx::UpperTriangular) = project.data(dx)
504+
506505
(project::ProjectTo{UnitUpperTriangular})(dx::Diagonal) = NoTangent()
507506
(project::ProjectTo{UnitLowerTriangular})(dx::Diagonal) = NoTangent()
508507

test/projection.jl

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -287,11 +287,9 @@ struct NoSuperType end
287287
@test pupp(rand(ComplexF32, 3, 3, 1)) isa UpperTriangular{Float64}
288288
@test ProjectTo(UpperTriangular(randn(3, 3) .> 0))(randn(3, 3)) == NoTangent()
289289

290-
if VERSION >= v"1.4" # not sure 1.4 exactly!
291-
phess = ProjectTo(UpperHessenberg(rand(3, 3)))
292-
@test phess(reshape(1:9,3,3)) == [1 4 7; 2 5 8; 0 6 9]
293-
@test phess(reshape(1:9,3,3) .+ im) isa UpperHessenberg{Float64}
294-
end
290+
phess = ProjectTo(UpperHessenberg(rand(3, 3)))
291+
@test phess(reshape(1:9,3,3)) == [1 4 7; 2 5 8; 0 6 9]
292+
@test phess(reshape(1:9,3,3) .+ im) isa UpperHessenberg{Float64}
295293

296294
pdu = ProjectTo(UnitLowerTriangular(rand(3, 3)))
297295
# NB, since the diagonal is constant 1, its gradient is zero:
@@ -494,7 +492,7 @@ struct NoSuperType end
494492
@test eval(Meta.parse(str))(ones(1, 3)) isa Adjoint{Float64,Vector{Float64}}
495493
end
496494

497-
VERSION > v"1.1" && @testset "allocation tests" begin
495+
@testset "allocation tests" begin
498496
# For sure these fail on Julia 1.0, not sure about 1.3 etc.
499497
# We only really care about current stable anyway
500498
# Each "@test 33 > ..." is zero on nightly, 32 on 1.5.

0 commit comments

Comments
 (0)