Skip to content

Commit 3cfa959

Browse files
authored
Fix indexing/slicing of ProductQ and infinite QLPackedQ (#127)
1 parent 8b122c8 commit 3cfa959

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "InfiniteLinearAlgebra"
22
uuid = "cde9dba0-b1de-11e9-2c62-0bab9446c55c"
3-
version = "0.6.14"
3+
version = "0.6.15"
44

55
[deps]
66
ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"
@@ -27,7 +27,7 @@ FillArrays = "0.13"
2727
InfiniteArrays = "0.12"
2828
LazyArrays = "0.22"
2929
LazyBandedMatrices = "0.8.4"
30-
MatrixFactorizations = "0.9.2"
30+
MatrixFactorizations = "0.9.6"
3131
SemiseparableMatrices = "0.3"
3232
julia = "1.6"
3333

src/banded/infqltoeplitz.jl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,8 @@ if VERSION < v"1.8-"
123123
lmul!(Q, y)
124124
end
125125
end
126-
if VERSION >= v"1.10-"
127-
getindex(Q::ProductQ, I::AbstractVector{Int}, J::AbstractVector{Int}) =
126+
getindex(Q::ProductQ, I::AbstractVector{Int}, J::AbstractVector{Int}) =
128127
hcat((Q[:,j][I] for j in J)...)
129-
end
130128

131129
getindex(Q::ProductQ{<:Any,<:Tuple{Vararg{LowerHessenbergQ}}}, i::Int, j::Int) = (Q')[j, i]'
132130

src/infql.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ end
9494

9595
getindex(Q::QLPackedQ{T,<:InfBandedMatrix{T}}, i::Int, j::Int) where T =
9696
(Q'*[Zeros{T}(i-1); one(T); Zeros{T}(∞)])[j]'
97+
getindex(Q::QLPackedQ{<:Any,<:InfBandedMatrix}, I::AbstractVector{Int}, J::AbstractVector{Int}) =
98+
[Q[i,j] for i in I, j in J]
9799

98100
getL(Q::QL, ::NTuple{2,InfiniteCardinal{0}}) = LowerTriangular(Q.factors)
99101
getL(Q::QLHessenberg, ::NTuple{2,InfiniteCardinal{0}}) = LowerTriangular(Q.factors)
@@ -173,7 +175,7 @@ function materialize!(M::Lmul{<:AdjQLPackedQLayout{<:BandedColumns},<:PaddedLayo
173175
B
174176
end
175177

176-
function _lmul_cache(A::AbstractMatrix{T}, x::AbstractVector{S}) where {T,S}
178+
function _lmul_cache(A::Union{AbstractMatrix{T},AbstractQ{T}}, x::AbstractVector{S}) where {T,S}
177179
TS = promote_op(matprod, T, S)
178180
lmul!(A, cache(convert(AbstractVector{TS},x)))
179181
end
@@ -264,6 +266,8 @@ end
264266

265267
getindex(Q::QLPackedQ{T,<:InfBlockBandedMatrix{T}}, i::Integer, j::Integer) where T =
266268
(Q'*Vcat(Zeros{T}(i-1), one(T), Zeros{T}(∞)))[j]'
269+
getindex(Q::QLPackedQ{<:Any,<:InfBlockBandedMatrix}, I::AbstractVector{Int}, J::AbstractVector{Int}) =
270+
[Q[i,j] for i in I, j in J]
267271

268272
function (*)(A::QLPackedQ{T,<:InfBlockBandedMatrix}, x::AbstractVector{S}) where {T,S}
269273
TS = promote_op(matprod, T, S)

0 commit comments

Comments
 (0)