Skip to content

Commit 1eeb1e1

Browse files
CompatHelper: bump compat for "ArrayLayouts" to "0.8" (#100)
* CompatHelper: bump compat for "ArrayLayouts" to "0.8" * Test on Julia v1.8 * update getindex for orthogonal * tests pass * Update Project.toml Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Sheehan Olver <[email protected]>
1 parent 03935d7 commit 1eeb1e1

File tree

9 files changed

+83
-73
lines changed

9 files changed

+83
-73
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ jobs:
1111
matrix:
1212
version:
1313
- '1.6'
14-
- '^1.7.0-0'
14+
- '1'
15+
- '^1.8.0-0'
1516
os:
1617
- ubuntu-latest
1718
- macOS-latest

Project.toml

Lines changed: 4 additions & 4 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.5"
3+
version = "0.6.6"
44

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

1919
[compat]
20-
ArrayLayouts = "0.7.7"
21-
BandedMatrices = "0.16.9"
20+
ArrayLayouts = "0.8"
21+
BandedMatrices = "0.17"
2222
BlockArrays = "0.16"
2323
BlockBandedMatrices = "0.11"
2424
DSP = "0.7"
2525
FillArrays = "0.12, 0.13"
2626
InfiniteArrays = "0.12"
2727
LazyArrays = "0.22"
2828
LazyBandedMatrices = "0.7.4"
29-
MatrixFactorizations = "0.8"
29+
MatrixFactorizations = "0.9"
3030
SemiseparableMatrices = "0.3"
3131
julia = "1.6"
3232

src/InfiniteLinearAlgebra.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import Base.Broadcast: BroadcastStyle, Broadcasted, broadcasted
1010

1111
import ArrayLayouts: colsupport, rowsupport, triangularlayout, MatLdivVec, triangulardata, TriangularLayout, TridiagonalLayout,
1212
sublayout, _qr, __qr, MatLmulVec, MatLmulMat, AbstractQLayout, materialize!, diagonaldata, subdiagonaldata, supdiagonaldata,
13-
_bidiag_forwardsub!, mulreduce, RangeCumsum, _factorize, transposelayout, ldiv!, lmul!, mul
13+
_bidiag_forwardsub!, mulreduce, RangeCumsum, _factorize, transposelayout, ldiv!, lmul!, mul, CNoPivot
1414
import BandedMatrices: BandedMatrix, _BandedMatrix, AbstractBandedMatrix, bandeddata, bandwidths, BandedColumns, bandedcolumns,
1515
_default_banded_broadcast, banded_similar
1616
import FillArrays: AbstractFill, getindex_value, axes_print_matrix_row

src/banded/hessenbergq.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,13 @@ end
141141
# getindex
142142
####
143143

144-
function getindex(Q::UpperHessenbergQ, i::Integer, j::Integer)
144+
function getindex(Q::UpperHessenbergQ, i::Int, j::Int)
145145
y = zeros(eltype(Q), size(Q, 2))
146146
y[j] = 1
147147
lmul!(Q, y)[i]
148148
end
149149

150-
getindex(Q::LowerHessenbergQ, i::Integer, j::Integer) = (Q')[j,i]'
150+
getindex(Q::LowerHessenbergQ, i::Int, j::Int) = (Q')[j,i]'
151151

152152

153153
###

src/banded/infqltoeplitz.jl

Lines changed: 53 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -4,98 +4,99 @@
44
# 0 d e]
55
#
66
# is the fixed point
7-
function tail_de(a::AbstractVector{T}; branch=findmax) where T<:Real
7+
function tail_de(a::AbstractVector{T}; branch=findmax) where {T<:Real}
88
m = length(a)
9-
C = [view(a,m-1:-1:1) Vcat(-a[end]*Eye(m-2), Zeros{T}(1,m-2))]
9+
C = [view(a, m-1:-1:1) Vcat(-a[end] * Eye(m - 2), Zeros{T}(1, m - 2))]
1010
λ, V = eigen(C)
1111
n2, j = branch(abs2.(λ))
1212
isreal(λ[j]) || throw(DomainError(a, "Real-valued QL factorization does not exist. Try ql(complex(A)) to see if a complex-valued QL factorization exists."))
1313
n2 a[end]^2 || throw(DomainError(a, "QL factorization does not exist. This could indicate that the operator is not Fredholm or that the dimension of the kernel exceeds that of the co-kernel. Try again with the adjoint."))
14-
c = sqrt((n2 - a[end]^2)/real(V[1,j])^2)
15-
c*real(V[end:-1:1,j])
14+
c = sqrt((n2 - a[end]^2) / real(V[1, j])^2)
15+
c * real(V[end:-1:1, j])
1616
end
1717

18-
function tail_de(a::AbstractVector{T}; branch=findmax) where T
18+
function tail_de(a::AbstractVector{T}; branch=findmax) where {T}
1919
m = length(a)
20-
C = [view(a,m-1:-1:1) Vcat(-a[end]*Eye(m-2), Zeros{T}(1,m-2))]
20+
C = [view(a, m-1:-1:1) Vcat(-a[end] * Eye(m - 2), Zeros{T}(1, m - 2))]
2121
λ, V = eigen(C)::Eigen{float(T),float(T),Matrix{float(T)},Vector{float(T)}}
2222
n2, j = branch(abs2.(λ))
23-
n2  abs2(a[end]) || throw(DomainError(a, "QL factorization does not exist. This could indicate that the operator is not Fredholm or that the dimension of the kernel exceeds that of the co-kernel. Try again with the adjoint."))
24-
c_abs = sqrt((n2 - abs2(a[end]))/abs2(V[1,j]))
25-
c_sgn = -sign(λ[j])/sign(V[1,j]*a[end-1] - V[2,j]*a[end])
26-
c_sgn*c_abs*V[end:-1:1,j]
23+
n2 abs2(a[end]) || throw(DomainError(a, "QL factorization does not exist. This could indicate that the operator is not Fredholm or that the dimension of the kernel exceeds that of the co-kernel. Try again with the adjoint."))
24+
c_abs = sqrt((n2 - abs2(a[end])) / abs2(V[1, j]))
25+
c_sgn = -sign(λ[j]) / sign(V[1, j] * a[end-1] - V[2, j] * a[end])
26+
c_sgn * c_abs * V[end:-1:1, j]
2727
end
2828

2929

3030
# this calculates the QL decomposition of X and corrects sign
3131
function ql_X!(X)
32-
s = sign(real(X[2,end]))
32+
s = sign(real(X[2, end]))
3333
F = ql!(X)
34-
if s sign(real(X[1,end-1])) # we need to normalise the sign if ql! flips it
34+
if s sign(real(X[1, end-1])) # we need to normalise the sign if ql! flips it
3535
F.τ[1] = 2 - F.τ[1] # 1-F.τ[1] is the sign so this flips it
36-
X[1,1:end-1] *= -1
36+
X[1, 1:end-1] *= -1
3737
end
3838
F
3939
end
4040

4141

4242

4343

44-
function ql(Op::TriToeplitz{T}; kwds...) where T<:Real
45-
Z,A,B = Op.dl.value, Op.d.value, Op.du.value
46-
d,e = tail_de([Z,A,B]; kwds...) # fixed point of QL but with two Qs, one that changes sign
44+
function ql(Op::TriToeplitz{T}; kwds...) where {T<:Real}
45+
Z, A, B = Op.dl.value, Op.d.value, Op.du.value
46+
d, e = tail_de([Z, A, B]; kwds...) # fixed point of QL but with two Qs, one that changes sign
4747
X = [Z A B; zero(T) d e]
4848
F = ql_X!(X)
49-
t,ω = F.τ[2],X[1,end]
50-
QL(_BandedMatrix(Hcat([zero(T), e, X[2,2], X[2,1]], [ω, X[2,3], X[2,2], X[2,1]] * Ones{T}(1,∞)), ℵ₀, 2, 1), Vcat(F.τ[1],Fill(t,∞)))
49+
t, ω = F.τ[2], X[1, end]
50+
QL(_BandedMatrix(Hcat([zero(T), e, X[2, 2], X[2, 1]], [ω, X[2, 3], X[2, 2], X[2, 1]] * Ones{T}(1, ∞)), ℵ₀, 2, 1), Vcat(F.τ[1], Fill(t, ∞)))
5151
end
5252

53-
ql(Op::TriToeplitz{T}) where T = ql(InfToeplitz(Op))
53+
ql(Op::TriToeplitz{T}) where {T} = ql(InfToeplitz(Op))
5454

5555
# ql for Lower hessenberg InfToeplitz
56-
function ql_hessenberg(A::InfToeplitz{T}; kwds...) where T
57-
l,u = bandwidths(A)
56+
function ql_hessenberg(A::InfToeplitz{T}; kwds...) where {T}
57+
l, u = bandwidths(A)
5858
@assert u == 1
5959
a = reverse(A.data.args[1])
6060
de = tail_de(a; kwds...)
6161
X = [transpose(a); zero(T) transpose(de)]::Matrix{float(T)}
6262
F = ql_X!(X) # calculate data for fixed point
63-
factors = _BandedMatrix(Hcat([zero(T); X[1,end-1]; X[2,end-1:-1:1]], [0; X[2,end:-1:1]] * Ones{float(T)}(1,∞)), ℵ₀, l+u, 1)
64-
QLHessenberg(factors, Fill(F.Q,∞))
63+
factors = _BandedMatrix(Hcat([zero(T); X[1, end-1]; X[2, end-1:-1:1]], [0; X[2, end:-1:1]] * Ones{float(T)}(1, ∞)), ℵ₀, l + u, 1)
64+
QLHessenberg(factors, Fill(F.Q, ∞))
6565
end
6666

6767

6868
# remove one band of A
6969
function ql_pruneband(A; kwds...)
70-
l,u = bandwidths(A)
71-
A_hess = A[:,u:end]
72-
Q,L = ql_hessenberg(A_hess; kwds...)
73-
p = size(_pertdata(bandeddata(parent(L))),2)+u+1 # pert size
74-
dat = (UpperHessenbergQ((Q').q[1:(p+l)])) * A[1:p+l+1,1:p]
75-
pert = Array{eltype(dat)}(undef, l+u+1,size(dat,2)-1)
70+
l, u = bandwidths(A)
71+
A_hess = A[:, u:end]
72+
Q, L = ql_hessenberg(A_hess; kwds...)
73+
p = size(_pertdata(bandeddata(parent(L))), 2) + u + 1 # pert size
74+
dat = (UpperHessenbergQ((Q').q[1:(p+l)])) * A[1:p+l+1, 1:p]
75+
pert = Array{eltype(dat)}(undef, l + u + 1, size(dat, 2) - 1)
7676
for j = 1:u
77-
pert[u-j+1:end,j] .= view(dat,1:l+j+1,j)
77+
pert[u-j+1:end, j] .= view(dat, 1:l+j+1, j)
7878
end
79-
for j = u+1:size(pert,2)
80-
pert[:,j] .= view(dat,j-u+1:j+l+1,j)
79+
for j = u+1:size(pert, 2)
80+
pert[:, j] .= view(dat, j-u+1:j+l+1, j)
8181
end
82-
H = _BandedMatrix(Hcat(pert, dat[end-l-u:end,end]*Ones{eltype(dat)}(1,∞)), ℵ₀, l+1,u-1)
83-
Q,H
82+
H = _BandedMatrix(Hcat(pert, dat[end-l-u:end, end] * Ones{eltype(dat)}(1, ∞)), ℵ₀, l + 1, u - 1)
83+
Q, H
8484
end
8585

8686
# represent Q as a product of orthogonal operations
87-
struct ProductQ{T,QQ<:Tuple} <: AbstractQ{T}
87+
struct ProductQ{T,QQ<:Tuple} <: LayoutQ{T}
8888
Qs::QQ
8989
end
9090

9191
ArrayLayouts.@layoutmatrix ProductQ
9292
ArrayLayouts.@_layoutlmul ProductQ
9393

94-
ProductQ(Qs::AbstractMatrix...) = ProductQ{mapreduce(eltype,promote_type,Qs),typeof(Qs)}(Qs)
94+
ProductQ(Qs::AbstractMatrix...) = ProductQ{mapreduce(eltype, promote_type, Qs),typeof(Qs)}(Qs)
9595

96-
adjoint(Q::ProductQ) = ProductQ(reverse(map(adjoint,Q.Qs))...)
96+
adjoint(Q::ProductQ) = ProductQ(reverse(map(adjoint, Q.Qs))...)
9797

9898
size(Q::ProductQ, dim::Integer) = size(dim == 1 ? Q.Qs[1] : last(Q.Qs), dim == 2 ? 1 : dim)
99+
axes(Q::ProductQ, dim::Integer) = axes(dim == 1 ? Q.Qs[1] : last(Q.Qs), dim == 2 ? 1 : dim)
99100

100101
function lmul!(Q::ProductQ, v::AbstractVecOrMat)
101102
for j = length(Q.Qs):-1:1
@@ -104,12 +105,19 @@ function lmul!(Q::ProductQ, v::AbstractVecOrMat)
104105
v
105106
end
106107

107-
getindex(Q::ProductQ{<:Any,<:Tuple{Vararg{LowerHessenbergQ}}}, i::Integer, j::Integer) = (Q')[j,i]'
108+
# Avoid ambiguities
109+
getindex(Q::ProductQ, i::Int, j::Int) = Q[:, j][i]
108110

111+
function getindex(Q::ProductQ, ::Colon, j::Int)
112+
y = zeros(eltype(Q), size(Q, 2))
113+
y[j] = 1
114+
lmul!(Q, y)
115+
end
116+
getindex(Q::ProductQ{<:Any,<:Tuple{Vararg{LowerHessenbergQ}}}, i::Int, j::Int) = (Q')[j, i]'
109117

110118
function _productq_mul(A::ProductQ{T}, x::AbstractVector{S}) where {T,S}
111119
TS = promote_op(matprod, T, S)
112-
lmul!(A, Base.copymutable(convert(AbstractVector{TS},x)))
120+
lmul!(A, Base.copymutable(convert(AbstractVector{TS}, x)))
113121
end
114122

115123
mul(A::ProductQ, x::AbstractVector) = _productq_mul(A, x)
@@ -123,7 +131,7 @@ end
123131

124132

125133

126-
QLProduct(Qs::Tuple, L::AbstractMatrix{T}) where T = QLProduct{T,typeof(Qs),typeof(L)}(Qs, L)
134+
QLProduct(Qs::Tuple, L::AbstractMatrix{T}) where {T} = QLProduct{T,typeof(Qs),typeof(L)}(Qs, L)
127135
QLProduct(F::QLHessenberg) = QLProduct(tuple(F.Q), F.L)
128136

129137
# iteration for destructuring into components
@@ -140,7 +148,8 @@ Matrix(F::QLProduct) = Array(AbstractArray(F))
140148
Array(F::QLProduct) = Matrix(F)
141149

142150
function show(io::IO, mime::MIME{Symbol("text/plain")}, F::QLProduct)
143-
summary(io, F); println(io)
151+
summary(io, F)
152+
println(io)
144153
println(io, "Q factor:")
145154
show(io, mime, F.Q)
146155
println(io, "\nL factor:")
@@ -163,11 +172,11 @@ end
163172
Base.propertynames(F::QLProduct, private::Bool=false) =
164173
(:L, :Q, (private ? fieldnames(typeof(F)) : ())...)
165174

166-
function _inf_ql(A::AbstractMatrix{T}; kwds...) where T
167-
_,u = bandwidths(A)
175+
function _inf_ql(A::AbstractMatrix{T}; kwds...) where {T}
176+
_, u = bandwidths(A)
168177
u 0 && return QLProduct(tuple(Eye{float(T)}(∞)), A)
169178
u == 1 && return QLProduct(ql_hessenberg(A; kwds...))
170-
Q1,H1 = ql_pruneband(A; kwds...)
179+
Q1, H1 = ql_pruneband(A; kwds...)
171180
= ql(H1; kwds...)
172181
QLProduct(tuple(Q1, F̃.Qs...), F̃.L)
173182
end

src/infcholesky.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ end
4545
adaptivecholesky(A) = Cholesky(AdaptiveCholeskyFactors(A), :U, 0)
4646

4747

48-
ArrayLayouts._cholesky(::SymmetricLayout{<:AbstractBandedLayout}, ::NTuple{2,OneToInf{Int}}, A) = adaptivecholesky(A)
48+
ArrayLayouts._cholesky(::SymmetricLayout{<:AbstractBandedLayout}, ::NTuple{2,OneToInf{Int}}, A, ::CNoPivot) = adaptivecholesky(A)
4949

5050
function colsupport(F::AdaptiveCholeskyFactors, j)
5151
partialcholesky!(F, maximum(j)+bandwidth(F,2))

src/infql.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ function ql_hessenberg!(B::InfBandedMatrix{TT}; kwds...) where TT
9696
QLHessenberg(_BandedMatrix(H, ℵ₀, l, 1), Vcat( LowerHessenbergQ(F.Q).q, F∞.q))
9797
end
9898

99-
getindex(Q::QLPackedQ{T,<:InfBandedMatrix{T}}, i::Integer, j::Integer) where T =
99+
getindex(Q::QLPackedQ{T,<:InfBandedMatrix{T}}, i::Int, j::Int) where T =
100100
(Q'*[Zeros{T}(i-1); one(T); Zeros{T}(∞)])[j]'
101101

102102
getL(Q::QL, ::NTuple{2,InfiniteCardinal{0}}) where T = LowerTriangular(Q.factors)

test/test_hessenbergq.jl

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,49 +3,49 @@ import InfiniteLinearAlgebra: UpperHessenbergQ, LowerHessenbergQ, tail_de, _Band
33

44
@testset "HessenbergQ" begin
55
@testset "finite UpperHessenbergQ" begin
6-
c,s = cos(0.1), sin(0.1); q = [c s; s -c];
6+
c,s = cos(0.1), sin(0.1); q = [c s; s -c];
77
Q = UpperHessenbergQ(Fill(q,1))
88
@test size(Q) == (size(Q,1),size(Q,2)) == (2,2)
99
@test Q q
1010
Q = UpperHessenbergQ(Fill(q,2))
1111
@test bandwidths(Q) == (1,2)
1212
@test Q [q zeros(2); zeros(1,2) 1] * [1 zeros(1,2); zeros(2) q]
1313
@test Q' isa LowerHessenbergQ
14-
@test Q' [1 zeros(1,2); zeros(2) q'] * [q' zeros(2); zeros(1,2) 1]
14+
@test Q' [1 zeros(1,2); zeros(2) q'] * [q' zeros(2); zeros(1,2) 1]
1515

1616
q = qr(randn(2,2) + im*randn(2,2)).Q
1717
Q = UpperHessenbergQ(Fill(q,1))
1818
@test Q q
1919
Q = UpperHessenbergQ(Fill(q,2))
2020
@test bandwidths(Q) == (1,2)
21-
@test Q [q zeros(2); zeros(1,2) 1] * [1 zeros(1,2); zeros(2) q]
21+
@test Q [q zeros(2); zeros(1,2) 1] * [1 zeros(1,2); zeros(2) q]
2222
@test Q' isa LowerHessenbergQ
23-
@test Q' [1 zeros(1,2); zeros(2) q'] * [q' zeros(2); zeros(1,2) 1]
23+
@test Q' [1 zeros(1,2); zeros(2) q'] * [q' zeros(2); zeros(1,2) 1]
2424
end
2525

2626
@testset "finite LowerHessenbergQ" begin
27-
c,s = cos(0.1), sin(0.1); q = [c s; s -c];
27+
c,s = cos(0.1), sin(0.1); q = [c s; s -c];
2828
Q = LowerHessenbergQ(Fill(q,1))
2929
@test size(Q) == (size(Q,1),size(Q,2)) == (2,2)
3030
@test Q q
3131
Q = LowerHessenbergQ(Fill(q,2))
3232
@test bandwidths(Q) == (2,1)
33-
@test Q [1 zeros(1,2); zeros(2) q] * [q zeros(2); zeros(1,2) 1]
33+
@test Q [1 zeros(1,2); zeros(2) q] * [q zeros(2); zeros(1,2) 1]
3434
@test Q' isa UpperHessenbergQ
35-
@test Q' [q' zeros(2); zeros(1,2) 1] * [1 zeros(1,2); zeros(2) q']
35+
@test Q' [q' zeros(2); zeros(1,2) 1] * [1 zeros(1,2); zeros(2) q']
3636

3737
q = qr(randn(2,2) + im*randn(2,2)).Q
3838
Q = LowerHessenbergQ(Fill(q,1))
3939
@test Q q
4040
Q = LowerHessenbergQ(Fill(q,2))
4141
@test bandwidths(Q) == (2,1)
42-
@test Q [1 zeros(1,2); zeros(2) q] * [q zeros(2); zeros(1,2) 1]
42+
@test Q [1 zeros(1,2); zeros(2) q] * [q zeros(2); zeros(1,2) 1]
4343
@test Q' isa UpperHessenbergQ
44-
@test Q' [q' zeros(2); zeros(1,2) 1] * [1 zeros(1,2); zeros(2) q']
44+
@test Q' [q' zeros(2); zeros(1,2) 1] * [1 zeros(1,2); zeros(2) q']
4545
end
4646

4747
@testset "infinite-Q" begin
48-
c,s = cos(0.1), sin(0.1); q = [c s; s -c];
48+
c,s = cos(0.1), sin(0.1); q = [c s; s -c];
4949
Q = LowerHessenbergQ(Fill(q,∞))
5050
@test Q[1,1] 0.9950041652780258
5151
Q = UpperHessenbergQ(Fill(q,∞))
@@ -58,7 +58,7 @@ import InfiniteLinearAlgebra: UpperHessenbergQ, LowerHessenbergQ, tail_de, _Band
5858
Q,R = qr(A)
5959
@test UpperHessenbergQ(Q) Q
6060
Q,L = ql(A)
61-
@test LowerHessenbergQ(Q) Q
61+
@test LowerHessenbergQ(Q) Q
6262
end
6363
end
64-
end
64+
end

test/test_infqr.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ import SemiseparableMatrices: AlmostBandedLayout, VcatAlmostBandedLayout
188188
@test qr(A) isa MatrixFactorizations.QR{Float64,<:InfiniteLinearAlgebra.AdaptiveQRFactors}
189189
@test factorize(A) isa MatrixFactorizations.QR{Float64,<:InfiniteLinearAlgebra.AdaptiveQRFactors}
190190

191-
@test (adaptiveqr(A) \ [ℯ; zeros(∞)])[1:1000] (qr(A) \ [ℯ; zeros(∞)])[1:1000] (A \ [ℯ; zeros(∞)])[1:1000] [1/factorial(1.0k) for k=0:999]
191+
@test (adaptiveqr(A) \ [ℯ; zeros(∞)])[1:1000] (qr(A) \ [ℯ; zeros(∞)])[1:1000] (A \ [ℯ; zeros(∞)])[1:1000] [1/gamma(k+1.0) for k=0:999]
192192
end
193193

194194
@testset "two-bands" begin
@@ -202,22 +202,22 @@ import SemiseparableMatrices: AlmostBandedLayout, VcatAlmostBandedLayout
202202
x = 0.1
203203
@test (exp(1 - x)*(-1 + exp(2 + 2x)))/(-1 + exp(4)) dot(u[1:1000], x.^(0:999))
204204
u = qr(A) \ Vcat([ℯ,1/ℯ], zeros(∞))
205-
@test u[1:1000] [1/factorial(1.0k) for k=0:999]
205+
@test u[1:1000] [1/gamma(k+1.0) for k=0:999]
206206
u = qr(A) \ Vcat(ℯ,1/ℯ, zeros(∞))
207-
@test u[1:1000] [1/factorial(1.0k) for k=0:999]
207+
@test u[1:1000] [1/gamma(k+1.0) for k=0:999]
208208
u = qr(A) \ [ℯ; 1/ℯ; zeros(∞)]
209-
@test u[1:1000] [1/factorial(1.0k) for k=0:999]
209+
@test u[1:1000] [1/gamma(k+1.0) for k=0:999]
210210

211211
A = Vcat(Ones(1,∞), ((-1.0).^(0:∞))', B)
212212
@test MemoryLayout(typeof(A)) isa VcatAlmostBandedLayout
213213
u = A \ Vcat(ℯ,1/ℯ, zeros(∞))
214-
@test u[1:1000] [1/factorial(1.0k) for k=0:999]
214+
@test u[1:1000] [1/gamma(k+1.0) for k=0:999]
215215
u = qr(A) \ [ℯ; 1/ℯ; zeros(∞)]
216-
@test u[1:1000] [1/factorial(1.0k) for k=0:999]
216+
@test u[1:1000] [1/gamma(k+1.0) for k=0:999]
217217

218218
A = Vcat(Ones(1,∞), ((-1).^(0:∞))', B)
219219
u = A \ [ℯ; 1/ℯ; zeros(∞)]
220-
@test u[1:1000] [1/factorial(1.0k) for k=0:999]
220+
@test u[1:1000] [1/gamma(k+1.0) for k=0:999]
221221
end
222222

223223
@testset "more bands" begin

0 commit comments

Comments
 (0)