Skip to content

Commit 409083c

Browse files
authored
Fix \ for QL (#34)
* Fix \ for QL * L truncations are banded * v0.3.5 * Update .travis.yml
1 parent 9b37d8c commit 409083c

File tree

5 files changed

+28
-11
lines changed

5 files changed

+28
-11
lines changed

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ matrix:
1313
- julia: nightly
1414
notifications:
1515
email: false
16-
after_success:
17-
- julia -e 'using Pkg; Pkg.add("Coverage"); using Coverage; Codecov.submit(process_folder())'
16+
codecov: true
1817

1918
# uncomment the following lines to override the default test script
2019
#script:

Project.toml

Lines changed: 8 additions & 8 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.3.4"
3+
version = "0.3.5"
44

55
[deps]
66
ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"
@@ -16,13 +16,13 @@ MatrixFactorizations = "a3b82374-2e81-5b9e-98ce-41277c0e4c87"
1616
SemiseparableMatrices = "f8ebbe35-cbfb-4060-bf7f-b10e4670cf57"
1717

1818
[compat]
19-
ArrayLayouts = "0.3.4"
20-
BandedMatrices = "0.15.11"
21-
BlockArrays = "0.12.7"
22-
BlockBandedMatrices = "0.8.5"
23-
FillArrays = "0.8.10"
24-
InfiniteArrays = "0.7.2"
25-
LazyArrays = "0.16.12"
19+
ArrayLayouts = "0.3.5"
20+
BandedMatrices = "0.15.13"
21+
BlockArrays = "0.12.8"
22+
BlockBandedMatrices = "0.8.7"
23+
FillArrays = "0.8.11"
24+
InfiniteArrays = "0.7.3"
25+
LazyArrays = "0.16.13"
2626
LazyBandedMatrices = "0.2.11"
2727
MatrixFactorizations = "0.4.1"
2828
SemiseparableMatrices = "0.1"

src/banded/infbanded.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ end
309309

310310
const BandedToeplitzLayout = BandedColumns{ConstRows}
311311
const PertToeplitzLayout = BandedColumns{PertConstRows}
312+
const PertTriangularToeplitzLayout{UPLO,UNIT} = TriangularLayout{UPLO,UNIT,BandedColumns{PertConstRows}}
312313

313314

314315
_BandedMatrix(::BandedToeplitzLayout, A::AbstractMatrix) =

src/banded/infqltoeplitz.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,14 @@ end
104104
getindex(Q::ProductQ{<:Any,<:Tuple{Vararg{LowerHessenbergQ}}}, i::Integer, j::Integer) = (Q')[j,i]'
105105

106106

107-
function (*)(A::ProductQ{T}, x::AbstractVector{S}) where {T,S}
107+
function _productq_mul(A::ProductQ{T}, x::AbstractVector{S}) where {T,S}
108108
TS = promote_op(matprod, T, S)
109109
lmul!(A, Base.copymutable(convert(AbstractVector{TS},x)))
110110
end
111111

112+
(*)(A::ProductQ, x::AbstractVector) = _productq_mul(A, x)
113+
(*)(A::ProductQ, x::LazyVector) = _productq_mul(A, x)
114+
112115

113116
# LQ where Q is a product of orthogonal operations
114117
struct QLProduct{T,QQ<:Tuple,LL} <: Factorization{T}

test/test_infql.jl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,5 +164,19 @@ import BandedMatrices: _BandedMatrix
164164
@testset "solve with QL" begin
165165
A = BandedMatrix(-1 => Fill(2,∞), 0 => Fill(5,∞), 1 => Fill(0.5,∞))
166166
@test (qr(A)\Vcat(1.0,Zeros(∞)))[1:1000] (ql(A)\Vcat(1.0,Zeros(∞)))[1:1000]
167+
168+
J = BandedMatrix(0 => Vcat([1.0], Fill(0.0,∞)), 1 => Vcat(Float64[],Fill(0.5,∞)), -1 => Vcat(Float64[],Fill(0.5,∞)))
169+
z = 3.5
170+
A = J - z*I
171+
F = ql(A)
172+
Q,L = F
173+
b = [1; zeros(∞)]
174+
@test (Q'b)[1] 0.9892996329463546
175+
@test L[1] == L[1,1]
176+
177+
@test L[1:5,1:5] isa BandedMatrix
178+
@test (L*(L \ b))[1:10] [1; zeros(9)]
179+
u = F \ b
180+
@test (A*u)[1:10] [1; zeros(9)]
167181
end
168182
end

0 commit comments

Comments
 (0)