Skip to content

Commit 6874396

Browse files
authored
Drop Julia <v1.10 (#68)
* Drop Julia <v1.10 * Update ci.yml * increase coverage
1 parent a10468b commit 6874396

File tree

12 files changed

+33
-94
lines changed

12 files changed

+33
-94
lines changed

.github/workflows/ci.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,8 @@ jobs:
2020
fail-fast: false
2121
matrix:
2222
version:
23-
- '1.9'
23+
- 'lts'
2424
- '1'
25-
- '^1.11.0-0'
2625
os:
2726
- ubuntu-latest
2827
- macOS-latest

Project.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "MatrixFactorizations"
22
uuid = "a3b82374-2e81-5b9e-98ce-41277c0e4c87"
3-
version = "3.0.1"
3+
version = "3.1"
44

55
[deps]
66
ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"
@@ -18,7 +18,7 @@ MatrixFactorizationsBandedMatricesExt = "BandedMatrices"
1818
[compat]
1919
ArrayLayouts = "1.9.2"
2020
BandedMatrices = "1.6"
21-
julia = "1.9"
21+
julia = "1.10"
2222

2323
[extras]
2424
BandedMatrices = "aae01518-5342-5314-be14-df237901396f"

src/MatrixFactorizations.jl

+3-30
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,8 @@ import LinearAlgebra: cholesky, cholesky!, norm, diag, eigvals!, eigvals, eigen!
1212
checknonsingular, ipiv2perm, copytri!, issuccess, RealHermSymComplexHerm,
1313
cholcopy, checkpositivedefinite, char_uplo, copymutable_oftype
1414

15-
if VERSION v"1.10-"
16-
using LinearAlgebra: TransposeFactorization, AdjointFactorization
17-
else
18-
const TransposeFactorization = Transpose
19-
const AdjointFactorization = Adjoint
2015

21-
end
16+
using LinearAlgebra: TransposeFactorization, AdjointFactorization
2217

2318
import Base: getindex, setindex!, *, +, -, ==, <, <=, >,
2419
>=, /, ^, \, transpose, showerror, reindex, checkbounds, @propagate_inbounds
@@ -53,6 +48,8 @@ const TransposeFact = isdefined(LinearAlgebra, :TransposeFactorization) ? Linear
5348
# objects are flexible in size when multiplied from the left, or its adjoint
5449
# from the right.
5550
abstract type LayoutQ{T} <: AbstractQ{T} end
51+
52+
5653
@_layoutlmul LayoutQ
5754
@_layoutlmul AdjointQtype{<:Any,<:LayoutQ}
5855
@_layoutrmul LayoutQ
@@ -109,30 +106,6 @@ end
109106
*(A::AbstractTriangular, B::LayoutQ) = mul(A, B)
110107
*(A::AbstractTriangular, B::AdjointQtype{<:Any,<:LayoutQ}) = mul(A, B)
111108

112-
if VERSION < v"1.10-"
113-
(*)(Q::LayoutQ, b::StridedVector) = _mul(Q, b)
114-
(*)(Q::LayoutQ, B::StridedMatrix) = _mul(Q, B)
115-
(*)(Q::LayoutQ, B::Adjoint{<:Any,<:StridedVecOrMat}) = _mul(Q, B)
116-
(*)(A::StridedMatrix, adjQ::AdjointQtype{<:Any,<:LayoutQ}) = _mul(A, adjQ)
117-
(*)(A::Adjoint{<:Any,<:StridedMatrix}, adjQ::AdjointQtype{<:Any,<:LayoutQ}) = _mul(A, adjQ)
118-
119-
Base.@propagate_inbounds getindex(Q::LayoutQ, i::Int, j::Int) = Q[:, j][i]
120-
function getindex(Q::LayoutQ, ::Colon, j::Int)
121-
y = zeros(eltype(Q), size(Q, 2))
122-
y[j] = 1
123-
lmul!(Q, y)
124-
end
125-
Base.@propagate_inbounds layout_getindex(A::LayoutQ, I::CartesianIndex) = A[to_indices(A, (I,))...]
126-
Base.@propagate_inbounds layout_getindex(A::LayoutQ, I::Int...) =
127-
Base.invoke(Base.getindex, Tuple{AbstractQ, typeof.(I)...}, A, I...)
128-
Base.@propagate_inbounds layout_getindex(A::LayoutQ, I::AbstractVector{Int}, J::AbstractVector{Int}) =
129-
hcat((A[:, j][I] for j in J)...)
130-
131-
(*)(Q::LayoutQ, adjQ::Adjoint{<:Any,<:LayoutQ}) = mul(Q, adjQ)
132-
(*)(adjQ::Adjoint{<:Any,<:LayoutQ}, Q::LayoutQ) = mul(adjQ, Q)
133-
(*)(adjQ::Adjoint{<:Any,<:LayoutQ}, adjP::Adjoint{<:Any,<:LayoutQ}) = mul(adjQ, adjP)
134-
end
135-
136109
axes(Q::LayoutQ, dim::Integer) = axes(getfield(Q, :factors), dim == 2 ? 1 : dim)
137110
axes(Q::LayoutQ) = axes(Q, 1), axes(Q, 2)
138111
copy(Q::LayoutQ) = Q

src/polar.jl

-5
Original file line numberDiff line numberDiff line change
@@ -486,11 +486,6 @@ mutable struct QDWHUpdater{T} <: PolarUpdater
486486
L::T # a lower bound for the smallest singluar value of each update matrix U
487487
end
488488

489-
490-
if VERSION < v"1.7-"
491-
ColumnNorm() = Val(true)
492-
end
493-
494489
function update_U!(upd::QDWHUpdater, U::Matrix{T}) where {T}
495490
piv = upd.piv
496491
L = upd.L

src/ql.jl

+1-9
Original file line numberDiff line numberDiff line change
@@ -265,15 +265,7 @@ Matrix{T}(Q::QLPackedQ{S}) where {T,S} =
265265
convert(Matrix{T}, lmul!(Q, Matrix{S}(I, size(Q, 1), min(size(Q.factors)...))))
266266
Matrix(Q::QLPackedQ{S}) where {S} = Matrix{S}(Q)
267267

268-
if VERSION < v"1.10-"
269-
AbstractMatrix{T}(Q::QLPackedQ{T}) where {T} = Q
270-
AbstractMatrix{T}(Q::QLPackedQ) where {T} = QLPackedQ{T}(Q)
271-
convert(::Type{AbstractMatrix{T}}, Q::QLPackedQ) where {T} = QLPackedQ{T}(Q)
272-
convert(::Type{AbstractMatrix{T}}, adjQ::Adjoint{<:Any,<:QLPackedQ}) where {T} =
273-
(QLPackedQ{T}(parent(adjQ)))'
274-
else
275-
AbstractMatrix{T}(Q::QLPackedQ) where {T} = Matrix{T}(Q)
276-
end
268+
AbstractMatrix{T}(Q::QLPackedQ) where {T} = Matrix{T}(Q)
277269

278270
size(Q::QLPackedQ, dim::Integer) = size(getfield(Q, :factors), dim == 2 ? 1 : dim)
279271

src/qr.jl

+4-9
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,9 @@ struct QRPackedQ{T,S<:AbstractMatrix{T},Tau<:AbstractVector{T}} <: LayoutQ{T}
160160
new{T,S,Tau}(factors, τ)
161161
end
162162
end
163+
164+
165+
163166
QRPackedQ(factors::AbstractMatrix{T}, τ::AbstractVector{T}) where {T} = QRPackedQ{T,typeof(factors),typeof(τ)}(factors, τ)
164167
function QRPackedQ{T}(factors::AbstractMatrix, τ::AbstractVector) where {T}
165168
QRPackedQ(convert(AbstractMatrix{T}, factors), convert(AbstractVector{T}, τ))
@@ -176,15 +179,7 @@ Matrix{T}(Q::QRPackedQ{S}) where {T,S} =
176179
convert(Matrix{T}, lmul!(Q, Matrix{S}(I, size(Q, 1), min(size(Q.factors)...))))
177180
Matrix(Q::QRPackedQ{S}) where {S} = Matrix{S}(Q)
178181

179-
if VERSION < v"1.10-"
180-
AbstractMatrix{T}(Q::QRPackedQ{T}) where {T} = Q
181-
AbstractMatrix{T}(Q::QRPackedQ) where {T} = QRPackedQ{T}(Q)
182-
convert(::Type{AbstractMatrix{T}}, Q::QRPackedQ) where {T} = QRPackedQ{T}(Q)
183-
convert(::Type{AbstractMatrix{T}}, adjQ::Adjoint{<:Any,<:QRPackedQ}) where {T} =
184-
(QRPackedQ{T}(parent(adjQ)))'
185-
else
186-
AbstractMatrix{T}(Q::QRPackedQ) where {T} = Matrix{T}(Q)
187-
end
182+
AbstractMatrix{T}(Q::QRPackedQ) where {T} = Matrix{T}(Q)
188183

189184
size(F::QR, dim::Integer) = size(getfield(F, :factors), dim)
190185
size(F::QR) = size(getfield(F, :factors))

src/rq.jl

+1-10
Original file line numberDiff line numberDiff line change
@@ -122,16 +122,7 @@ Matrix(Q::RQPackedQ{S}) where {S} = Matrix{S}(Q)
122122
AbstractQ{T}(Q::RQPackedQ{T}) where {T} = Q
123123
AbstractQ{T}(Q::RQPackedQ) where {T} = RQPackedQ{T}(Q)
124124
convert(::Type{AbstractQ{T}}, Q::RQPackedQ) where {T} = RQPackedQ{T}(Q)
125-
126-
if VERSION < v"1.10-"
127-
AbstractMatrix{T}(Q::RQPackedQ{T}) where {T} = Q
128-
AbstractMatrix{T}(Q::RQPackedQ) where {T} = RQPackedQ{T}(Q)
129-
convert(::Type{AbstractMatrix{T}}, Q::RQPackedQ) where {T} = RQPackedQ{T}(Q)
130-
convert(::Type{AbstractMatrix{T}}, adjQ::Adjoint{<:Any,<:RQPackedQ}) where {T} =
131-
(RQPackedQ{T}(parent(adjQ)))'
132-
else
133-
AbstractMatrix{T}(Q::RQPackedQ) where {T} = Matrix{T}(Q)
134-
end
125+
AbstractMatrix{T}(Q::RQPackedQ) where {T} = Matrix{T}(Q)
135126

136127
Base.size(Q::RQPackedQ, dim::Integer) = size(getfield(Q, :factors), dim == 1 ? 2 : dim)
137128
Base.size(Q::RQPackedQ) = size(Q, 1), size(Q, 2)

src/ul.jl

+1-3
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,7 @@ end
9999
# ul!(A.data, pivot; check = check)
100100
# end
101101

102-
if VERSION < v"1.7-"
103-
_checknonsingular(info, ::Val{Pivot}) where Pivot = checknonsingular(info, Val{Pivot}())
104-
elseif VERSION < v"1.11-"
102+
if VERSION < v"1.11-"
105103
_checknonsingular(info, ::Val{true}) = checknonsingular(info, RowMaximum())
106104
_checknonsingular(info, ::Val{false}) = checknonsingular(info, NoPivot())
107105
else

test/test_ql.jl

+6-5
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,7 @@ using MatrixFactorizations, ArrayLayouts, Test
9595
sq = size(q.factors, 1)
9696
@test *(LowerTriangular(Matrix{eltyb}(I, sq, sq)), adjoint(q))*squareQ(q) Matrix(I, a_1, a_1) atol=5000ε
9797
if eltya != Int
98-
if VERSION < v"1.10-"
99-
@test Matrix{eltyb}(I, a_1, a_1)*q convert(AbstractMatrix{tab}, q)
100-
else
101-
@test Matrix{eltyb}(I, a_1, a_1)*q squareQ(convert(LinearAlgebra.AbstractQ{tab}, q))
102-
end
98+
@test Matrix{eltyb}(I, a_1, a_1)*q squareQ(convert(LinearAlgebra.AbstractQ{tab}, q))
10399
end
104100
end
105101
end
@@ -214,4 +210,9 @@ using MatrixFactorizations, ArrayLayouts, Test
214210
@test rowsupport(Q, 4) colsupport(Q', 4) Base.OneTo(5)
215211
@test colsupport(Q, 4) rowsupport(Q', 4) 3:10
216212
end
213+
214+
@testset "AbstractMatrix conversion" begin
215+
Q = ql(randn(5,5)).Q
216+
@test AbstractMatrix{Float64}(Q) isa Matrix{Float64}
217+
end
217218
end

test/test_qr.jl

+7-10
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,7 @@ rectangularQ(Q::LinearAlgebra.AbstractQ) = Matrix(Q) # convert(Array, Q)
6161
sq = size(q.factors, 2)
6262
@test *(Matrix{eltyb}(I, sq, sq), adjoint(q)) * squareQ(q) Matrix(I, sq, sq) atol=5000ε
6363
if eltya != Int
64-
if VERSION < v"1.10-"
65-
@test Matrix{eltyb}(I, a_1, a_1)*q convert(AbstractMatrix{tab}, q)
66-
else
67-
@test Matrix{eltyb}(I, a_1, a_1)*q squareQ(convert(LinearAlgebra.AbstractQ{tab}, q))
68-
end
64+
@test Matrix{eltyb}(I, a_1, a_1)*q squareQ(convert(LinearAlgebra.AbstractQ{tab}, q))
6965
ac = copy(a)
7066
@test qrunblocked!(a[:, 1:5])\b == qrunblocked!(view(ac, :, 1:5))\b
7167
end
@@ -91,11 +87,7 @@ rectangularQ(Q::LinearAlgebra.AbstractQ) = Matrix(Q) # convert(Array, Q)
9187
sq = size(q.factors, 1)
9288
@test *(LowerTriangular(Matrix{eltyb}(I, sq, sq)), adjoint(q))*squareQ(q) Matrix(I, a_1, a_1) atol=5000ε
9389
if eltya != Int
94-
if VERSION < v"1.10-"
95-
@test Matrix{eltyb}(I, a_1, a_1)*q convert(AbstractMatrix{tab}, q)
96-
else
97-
@test Matrix{eltyb}(I, a_1, a_1)*q squareQ(convert(LinearAlgebra.AbstractQ{tab}, q))
98-
end
90+
@test Matrix{eltyb}(I, a_1, a_1)*q squareQ(convert(LinearAlgebra.AbstractQ{tab}, q))
9991
end
10092
end
10193
end
@@ -208,4 +200,9 @@ rectangularQ(Q::LinearAlgebra.AbstractQ) = Matrix(Q) # convert(Array, Q)
208200
@test rowsupport(Q, 4) colsupport(Q', 4) 3:10
209201
@test colsupport(Q, 4) rowsupport(Q', 4) Base.OneTo(5)
210202
end
203+
204+
@testset "AbstractMatrix conversion" begin
205+
Q = qrunblocked(randn(5,5)).Q
206+
@test AbstractMatrix{Float64}(Q) isa Matrix{Float64}
207+
end
211208
end

test/test_reversecholesky.jl

+1-4
Original file line numberDiff line numberDiff line change
@@ -298,10 +298,7 @@ end
298298

299299
# complex, failing
300300
D[2, 2] = 0.0 + 0im
301-
if VERSION v"1.10"
302-
@test_throws PosDefException reversecholesky(D)
303-
end
304-
301+
@test_throws PosDefException reversecholesky(D)
305302

306303
# InexactError for Int
307304
@test_throws InexactError reversecholesky!(Diagonal([2, 1]))

test/test_rq.jl

+6-5
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,7 @@ const Our=MatrixFactorizations
105105
sq = size(q.factors, 2)
106106
@test *(Matrix{eltyb}(I, sq, sq), adjoint(q)) * q Matrix(I, sq, sq) atol=5000ε
107107
if eltya != Int
108-
if VERSION < v"1.10-"
109-
@test Matrix{eltyb}(I, a_1, a_1)*q convert(AbstractMatrix{tab}, q)
110-
else
111-
@test Matrix{eltyb}(I, a_1, a_1)*q squareQ(convert(LinearAlgebra.AbstractQ{tab}, q))
112-
end
108+
@test Matrix{eltyb}(I, a_1, a_1)*q squareQ(convert(LinearAlgebra.AbstractQ{tab}, q))
113109
ac = copy(a)
114110
# would need rectangular ldiv! method
115111
@test_throws DimensionMismatch rq!(a[:, 1:5])\b == rq!(view(ac, :, 1:5))\b
@@ -211,4 +207,9 @@ const Our=MatrixFactorizations
211207
@test rmul!(copy(c), Q) c*Matrix(Q)
212208
@test rmul!(copy(c), Q') c*Matrix(Q')
213209
end
210+
211+
@testset "AbstractMatrix conversion" begin
212+
Q = rq(randn(5,5)).Q
213+
@test AbstractMatrix{Float64}(Q) isa Matrix{Float64}
214+
end
214215
end

0 commit comments

Comments
 (0)