Skip to content

Support Q[::Int, ::AbstractRange] and variants #148

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ jobs:
fail-fast: false
matrix:
version:
- '1.6'
- '1'
- '1.9'
os:
- ubuntu-latest
- macOS-latest
Expand Down
8 changes: 4 additions & 4 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "InfiniteLinearAlgebra"
uuid = "cde9dba0-b1de-11e9-2c62-0bab9446c55c"
version = "0.6.24"
version = "0.7"

[deps]
ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"
Expand All @@ -24,10 +24,10 @@ BlockBandedMatrices = "0.12"
FillArrays = "1"
InfiniteArrays = "0.13"
LazyArrays = "1.3"
LazyBandedMatrices = "0.8.7"
MatrixFactorizations = "1, 2"
LazyBandedMatrices = "0.8.7, 0.9"
MatrixFactorizations = "2.1"
SemiseparableMatrices = "0.3"
julia = "1.6"
julia = "1.9"

[extras]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
Expand Down
4 changes: 2 additions & 2 deletions src/InfiniteLinearAlgebra.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ import BandedMatrices: BandedMatrix, _BandedMatrix, AbstractBandedMatrix, banded
_default_banded_broadcast, banded_similar
import FillArrays: AbstractFill, getindex_value, axes_print_matrix_row
import InfiniteArrays: OneToInf, InfUnitRange, Infinity, PosInfinity, InfiniteCardinal, InfStepRange, AbstractInfUnitRange, InfAxes, InfRanges
import LinearAlgebra: matprod, qr, AbstractTriangular, AbstractQ, adjoint, transpose, AdjOrTrans
import LinearAlgebra: matprod, qr, AbstractTriangular, AbstractQ, adjoint, transpose, AdjOrTrans, copymutable
import LazyArrays: applybroadcaststyle, CachedArray, CachedMatrix, CachedVector, DenseColumnMajor, FillLayout, ApplyMatrix, check_mul_axes, LazyArrayStyle,
resizedata!, MemoryLayout, AbstractLazyLayout,
factorize, sub_materialize, LazyLayout, LazyArrayStyle, layout_getindex,
applylayout, ApplyLayout, PaddedLayout, CachedLayout, AbstractCachedVector, AbstractCachedMatrix, cacheddata, zero!, MulAddStyle, ApplyArray,
LazyArray, LazyMatrix, LazyVector, paddeddata, arguments, resizedata!, simplifiable, simplify, LazyLayouts
import MatrixFactorizations: ul, ul!, _ul, ql, ql!, _ql, QLPackedQ, getL, getR, getQ, getU, reflector!, reflectorApply!, QL, QR, QRPackedQ,
QRPackedQLayout, AdjQRPackedQLayout, QLPackedQLayout, AdjQLPackedQLayout, LayoutQ
QRPackedQLayout, AdjQRPackedQLayout, QLPackedQLayout, AdjQLPackedQLayout, LayoutQ, copymutable_size

import BlockArrays: AbstractBlockVecOrMat, sizes_from_blocks, _length, BlockedUnitRange, blockcolsupport, BlockLayout, AbstractBlockLayout, BlockSlice

Expand Down
4 changes: 3 additions & 1 deletion src/banded/infqltoeplitz.jl
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ function ql_pruneband(A; kwds...)
Q, H
end


copymutable_size(::NTuple{2,InfiniteCardinal{0}}, Q) = cache(Q)

# represent Q as a product of orthogonal operations
struct ProductQ{T,QQ<:Tuple} <: LayoutQ{T}
Qs::QQ
Expand Down Expand Up @@ -141,7 +144,6 @@ mul(Q::ProductQ, X::AbstractMatrix) = ApplyArray(*, Q.Qs...) * X
mul(X::AbstractMatrix, Q::ProductQ) = X * ApplyArray(*, Q.Qs...)



# LQ where Q is a product of orthogonal operations
struct QLProduct{T,QQ<:Tuple,LL} <: Factorization{T}
Qs::QQ
Expand Down
2 changes: 2 additions & 0 deletions test/test_infql.jl
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ using ArrayLayouts: TriangularLayout, UnknownLayout
@test (Q*L)[1:10,1:10] ≈ A[1:10,1:10]

@test (L*Q)[1:10,1:10] ≈ LazyBandedMatrices.SymTridiagonal(L*Q)[1:10,1:10]
@test Q[5,6:8] == [Q[5,k] for k = 6:8]
@test Q[6:8,5] == [Q[k,5] for k = 6:8]
end

@test_throws ErrorException ql(zeros(∞,∞))
Expand Down