Skip to content

Commit 15a0db4

Browse files
authored
InfiniteLinearAlgebra v0.10 (#136)
* InfiniteLinearAlgebra v0.10 * tests pass * v0.7
1 parent e031f18 commit 15a0db4

File tree

2 files changed

+22
-18
lines changed

2 files changed

+22
-18
lines changed

Project.toml

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "SemiclassicalOrthogonalPolynomials"
22
uuid = "291c01f3-23f6-4eb6-aeb0-063a639b53f2"
33
authors = ["Sheehan Olver <[email protected]>"]
4-
version = "0.6.1"
4+
version = "0.7"
55

66
[deps]
77
ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"
@@ -19,15 +19,15 @@ SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
1919

2020
[compat]
2121
ArrayLayouts = "1"
22-
BandedMatrices = "0.17, 1"
23-
ClassicalOrthogonalPolynomials = "0.14.3, 0.15"
24-
ContinuumArrays = "0.18, 0.19"
22+
BandedMatrices = "1"
23+
ClassicalOrthogonalPolynomials = "0.15.1"
24+
ContinuumArrays = "0.19"
2525
FillArrays = "1"
2626
HypergeometricFunctions = "0.3.4"
27-
InfiniteArrays = "0.14, 0.15"
28-
InfiniteLinearAlgebra = "0.9.1"
27+
InfiniteArrays = "0.15"
28+
InfiniteLinearAlgebra = "0.10"
2929
LazyArrays = "2.4"
30-
QuasiArrays = "0.11, 0.12"
30+
QuasiArrays = "0.12"
3131
SpecialFunctions = "1.0, 2"
3232
julia = "1.10"
3333

src/SemiclassicalOrthogonalPolynomials.jl

+15-11
Original file line numberDiff line numberDiff line change
@@ -159,16 +159,17 @@ function semiclassical_jacobimatrix(t, a, b, c)
159159
return Tridiagonal(B, A, C)
160160
else
161161
P = Normalized(jacobi(b, a, UnitInterval{T}()))
162-
iszero(c) && return jacobimatrix(P)
162+
X = jacobimatrix(P)
163+
iszero(c) && return X
163164
if isone(c)
164-
return cholesky_jacobimatrix(Symmetric(P \ ((t.-axes(P,1)).*P)), P)
165+
return cholesky_jacobimatrix(Symmetric(P \ ((t.-axes(P,1)).*P)), X)[1]
165166
elseif isone(c/2)
166-
return qr_jacobimatrix(Symmetric(P \ ((t.-axes(P,1)).*P)), P)
167+
return qr_jacobimatrix(Symmetric(P \ ((t.-axes(P,1)).*P)), X)[1]
167168
elseif isinteger(c) && c 0 # reduce other integer c cases to hierarchy
168169
return SemiclassicalJacobi.(t, a, b, 0:Int(c))[end].X
169170
else # if c is not an integer, use Lanczos
170171
x = axes(P,1)
171-
return cholesky_jacobimatrix(@.(x^a * (1-x)^b * (t-x)^c), P)
172+
return cholesky_jacobimatrix(@.(x^a * (1-x)^b * (t-x)^c), P)[1]
172173
end
173174
end
174175
end
@@ -195,18 +196,19 @@ function semiclassical_jacobimatrix(Q::SemiclassicalJacobi, a, b, c)
195196
return semiclassical_jacobimatrix(newQ, a, b, c)
196197
end
197198

199+
X = jacobimatrix(Q)
198200
if isone(Δa/2) && iszero(Δb) && iszero(Δc) # raising by 2
199-
qr_jacobimatrix(Q.X,Q)
201+
qr_jacobimatrix(X,X)[1]
200202
elseif iszero(Δa) && isone(Δb/2) && iszero(Δc)
201-
qr_jacobimatrix(I-Q.X,Q)
203+
qr_jacobimatrix(I-X,X)[1]
202204
elseif iszero(Δa) && iszero(Δb) && isone(Δc/2)
203-
qr_jacobimatrix(Q.t*I-Q.X,Q)
205+
qr_jacobimatrix(Q.t*I-X,X)[1]
204206
elseif isone(Δa) && iszero(Δb) && iszero(Δc) # raising by 1
205-
cholesky_jacobimatrix(Q.X,Q)
207+
cholesky_jacobimatrix(X,X)[1]
206208
elseif iszero(Δa) && isone(Δb) && iszero(Δc)
207-
cholesky_jacobimatrix(I-Q.X,Q)
209+
cholesky_jacobimatrix(I-X,X)[1]
208210
elseif iszero(Δa) && iszero(Δb) && isone(Δc)
209-
cholesky_jacobimatrix(Q.t*I-Q.X,Q)
211+
cholesky_jacobimatrix(Q.t*I-X,X)[1]
210212
elseif isone(-Δa) && iszero(Δb) && iszero(Δc) # in these cases we currently have to reconstruct
211213
# TODO: This is re-constructing. It should instead use reverse Cholesky (or an alternative)!
212214
semiclassical_jacobimatrix(Q.t,a,b,c)
@@ -233,7 +235,9 @@ function semiclassical_jacobimatrix(Q::SemiclassicalJacobi, a, b, c)
233235
end
234236
end
235237

236-
ConvertedOrthogonalPolynomial(P::SemiclassicalJacobi{T}) where T = ConvertedOrthogonalPolynomial(orthogonalityweight(P), P.X, parent(P.X.dv).U, parent(P.X.dv).P)
238+
resizedata!(P::SemiclassicalJacobi, ::Colon, n::Int) = resizedata!(diagonaldata(P.X), n)
239+
240+
ConvertedOrthogonalPolynomial(P::SemiclassicalJacobi{T}) where T = ConvertedOrthogonalPolynomial(orthogonalityweight(P), P.X, P.X.dv.data.U, Normalized(jacobi(P.b, P.a, 0..1)))
237241

238242
"""
239243
toclassical(P::SemiclassicalJacobi)

0 commit comments

Comments
 (0)