@@ -8,19 +8,19 @@ import Base: getindex, axes, size, \, /, *, +, -, summary, show, ==, copy, sum,
8
8
import ArrayLayouts: MemoryLayout, ldiv, diagonaldata, subdiagonaldata, supdiagonaldata
9
9
import BandedMatrices: bandwidths, AbstractBandedMatrix, BandedLayout, _BandedMatrix
10
10
import LazyArrays: resizedata!, paddeddata, CachedVector, CachedMatrix, CachedAbstractVector, LazyMatrix, LazyVector, arguments, ApplyLayout, colsupport, AbstractCachedVector, ApplyArray,
11
- AccumulateAbstractVector, LazyVector, AbstractCachedMatrix, BroadcastLayout
11
+ AccumulateAbstractVector, LazyVector, AbstractCachedMatrix, BroadcastLayout, simplifiable
12
12
import ClassicalOrthogonalPolynomials: OrthogonalPolynomial, recurrencecoefficients, jacobimatrix, normalize, _p0, UnitInterval, orthogonalityweight, NormalizedOPLayout, MappedOPLayout,
13
13
Bidiagonal, Tridiagonal, SymTridiagonal, symtridiagonalize, normalizationconstant, LanczosPolynomial,
14
14
OrthogonalPolynomialRatio, Weighted, AbstractWeightLayout, UnionDomain, oneto, WeightedBasis, HalfWeighted,
15
- golubwelsch, AbstractOPLayout, weight, cholesky_jacobimatrix, qr_jacobimatrix, isnormalized
15
+ golubwelsch, AbstractOPLayout, weight, cholesky_jacobimatrix, qr_jacobimatrix, isnormalized, ConvertedOrthogonalPolynomial, AbstractNormalizedOPLayout
16
16
17
17
import InfiniteArrays: OneToInf, InfUnitRange
18
18
import ContinuumArrays: basis, Weight, @simplify , AbstractBasisLayout, BasisLayout, MappedBasisLayout, grid, plotgrid, equals_layout, ExpansionLayout
19
19
import FillArrays: SquareEye
20
20
import HypergeometricFunctions: _₂F₁general2, _₂F₁
21
21
import SpecialFunctions: beta
22
22
23
- export LanczosPolynomial, Legendre, Normalized, normalize, SemiclassicalJacobi, SemiclassicalJacobiWeight, WeightedSemiclassicalJacobi, OrthogonalPolynomialRatio
23
+ export Legendre, Normalized, normalize, SemiclassicalJacobi, SemiclassicalJacobiWeight, WeightedSemiclassicalJacobi, OrthogonalPolynomialRatio
24
24
25
25
""" "
26
26
SemiclassicalJacobiWeight(t, a, b, c)
@@ -131,7 +131,7 @@ WeightedSemiclassicalJacobi{T}(t, a, b, c, P...) where T = SemiclassicalJacobiWe
131
131
132
132
# Returns α, β such that P1(x) = β(x-α)
133
133
function _linear_coefficients (t, a, b, c)
134
- # beta(a + 1, b + 1) * t^c * _₂F₁(a + 1, -c, a + b + 2, 1/t) is the integral ∫₀¹ wᵗ⁽ᵃᵇᶜ⁾(x) dx
134
+ # beta(a + 1, b + 1) * t^c * _₂F₁(a + 1, -c, a + b + 2, 1/t) is the integral ∫₀¹ wᵗ⁽ᵃᵇᶜ⁾(x) dx
135
135
Γᵃ = beta (a + 1 , b + 1 ) * _₂F₁ (a + 1 , - c, a + b + 2 , 1 / t)
136
136
Γᵃ⁺¹ = beta (a + 2 , b + 1 ) * _₂F₁ (a + 2 , - c, a + b + 3 , 1 / t)
137
137
Γᵃ⁺² = beta (a + 3 , b + 1 ) * _₂F₁ (a + 3 , - c, a + b + 4 , 1 / t)
@@ -150,7 +150,7 @@ function semiclassical_jacobimatrix(t, a, b, c)
150
150
C = - (N). / (N.* 4 .- 2 )
151
151
B = Vcat ((α[1 ]^ 2 * 3 - α[1 ]* α[2 ]* 2 - 1 )/ 6 , - (N). / (N.* 4 .+ 2 ). * α[2 : end ]. / α)
152
152
return SymTridiagonal (A, sqrt .(B.* C)) # if J is Tridiagonal(c,a,b) then for norm. OPs it becomes SymTridiagonal(a, sqrt.( b.* c))
153
- elseif b == - one (T)
153
+ elseif b == - one (T)
154
154
J′ = semiclassical_jacobimatrix (t, a, one (b), c)
155
155
J′a, J′b = diagonaldata (J′), supdiagonaldata (J′)
156
156
A = Vcat (one (T), J′a[1 : end ])
@@ -168,7 +168,7 @@ function semiclassical_jacobimatrix(t, a, b, c)
168
168
return SemiclassicalJacobi .(t, a, b, 0 : Int (c))[end ]. X
169
169
else # if c is not an integer, use Lanczos
170
170
x = axes (P,1 )
171
- return jacobimatrix ( LanczosPolynomial ( @. (x^ a * (1 - x)^ b * (t- x)^ c), jacobi (b, a, UnitInterval {T} ())) )
171
+ return cholesky_jacobimatrix ( @. (x^ a * (1 - x)^ b * (t- x)^ c), P )
172
172
end
173
173
end
174
174
end
@@ -178,11 +178,11 @@ function semiclassical_jacobimatrix(Q::SemiclassicalJacobi, a, b, c)
178
178
Δb = b- Q. b
179
179
Δc = c- Q. c
180
180
181
- # special cases
181
+ # special cases
182
182
if iszero (a) && iszero (b) && c == - one (eltype (Q. t)) # (a,b,c) = (0,0,-1) special case
183
183
return semiclassical_jacobimatrix (Q. t, zero (Q. t), zero (Q. t), c)
184
184
elseif iszero (Δa) && iszero (Δc) && Δb == 2 && b == 1
185
- # When going from P[t, a, -1, c] to P[t, a, 1, c], you can just take
185
+ # When going from P[t, a, -1, c] to P[t, a, 1, c], you can just take
186
186
return SymTridiagonal (Q. X. d[2 : end ], Q. X. du[2 : end ])
187
187
elseif iszero (c) # classical Jacobi polynomial special case
188
188
return jacobimatrix (Normalized (jacobi (b, a, UnitInterval {eltype(Q.t)} ())))
@@ -233,15 +233,14 @@ function semiclassical_jacobimatrix(Q::SemiclassicalJacobi, a, b, c)
233
233
end
234
234
end
235
235
236
- LanczosPolynomial (P:: SemiclassicalJacobi{T} ) where T =
237
- LanczosPolynomial (orthogonalityweight (P), Normalized (jacobi (P. b, P. a, UnitInterval {T} ())), P. X. dv. data)
236
+ ConvertedOrthogonalPolynomial (P:: SemiclassicalJacobi{T} ) where T = ConvertedOrthogonalPolynomial (orthogonalityweight (P), P. X, parent (P. X. dv). U, parent (P. X. dv). P)
238
237
239
238
"""
240
239
toclassical(P::SemiclassicalJacobi)
241
240
242
- gives either a mapped `Jacobi` or `LanczosPolynomial ` version of `P`.
241
+ gives either a mapped `Jacobi` or `CholeskyPolynomial ` version of `P`.
243
242
"""
244
- toclassical (P:: SemiclassicalJacobi{T} ) where T = iszero (P. c) ? Normalized (jacobi (P. b, P. a, UnitInterval {T} ())) : LanczosPolynomial (P)
243
+ toclassical (P:: SemiclassicalJacobi{T} ) where T = iszero (P. c) ? Normalized (jacobi (P. b, P. a, UnitInterval {T} ())) : ConvertedOrthogonalPolynomial (P)
245
244
246
245
copy (P:: SemiclassicalJacobi ) = P
247
246
axes (P:: SemiclassicalJacobi{T} ) where T = (Inclusion (UnitInterval {T} ()),OneToInf ())
@@ -281,7 +280,7 @@ function op_lowering(Q, y)
281
280
end
282
281
283
282
function semijacobi_ldiv (Q, P:: SemiclassicalJacobi )
284
- if P. a ≤ 0 && P. b ≤ 0 && P. c ≤ 0
283
+ if P. a ≤ 0 && P. b ≤ 0 && P. c ≤ 0
285
284
P̃ = toclassical (P)
286
285
(Q \ P̃)/ _p0 (P̃)
287
286
else
298
297
"""
299
298
semijacobi_ldiv_direct(Q::SemiclassicalJacobi, P::SemiclassicalJacobi)
300
299
301
- Returns conversion operator from SemiclassicalJacobi `P` to SemiclassicalJacobi `Q` in a single step via decomposition.
300
+ Returns conversion operator from SemiclassicalJacobi `P` to SemiclassicalJacobi `Q` in a single step via decomposition.
302
301
Numerically unstable if the parameter modification is large. Typically one should instead use `P \\ Q` which is equivalent to `semijacobi_ldiv(P,Q)` and proceeds step by step.
303
302
"""
304
303
function semijacobi_ldiv_direct (Q:: SemiclassicalJacobi , P:: SemiclassicalJacobi )
365
364
"""
366
365
semijacobi_ldiv_direct(Q::SemiclassicalJacobi, P::SemiclassicalJacobi)
367
366
368
- Returns conversion operator from SemiclassicalJacobi `P` to SemiclassicalJacobi `Q`. Integer distances are covered by decomposition methods, for non-integer cases a Lanczos fallback is attempted .
367
+ Returns conversion operator from SemiclassicalJacobi `P` to SemiclassicalJacobi `Q`. Integer distances are covered by decomposition methods.
369
368
"""
370
369
function semijacobi_ldiv (Q:: SemiclassicalJacobi , P:: SemiclassicalJacobi )
371
370
@assert Q. t ≈ P. t
@@ -396,7 +395,7 @@ function semijacobi_ldiv(Q::SemiclassicalJacobi, P::SemiclassicalJacobi)
396
395
QQ = SemiclassicalJacobi (Q. t, Q. a, Q. b, Q. c+ 1 + iseven (Δc), P)
397
396
return ApplyArray (* ,semijacobi_ldiv_direct (Q, QQ),semijacobi_ldiv (QQ, P))
398
397
end
399
- else # fallback to Lancos
398
+ else # fallback
400
399
R = SemiclassicalJacobi (P. t, mod (P. a,- 1 ), mod (P. b,- 1 ), mod (P. c,- 1 ))
401
400
R̃ = toclassical (R)
402
401
return (P \ R) * _p0 (R̃) * (R̃ \ Q)
406
405
struct SemiclassicalJacobiLayout <: AbstractOPLayout end
407
406
MemoryLayout (:: Type{<:SemiclassicalJacobi} ) = SemiclassicalJacobiLayout ()
408
407
409
- copy (L:: Ldiv{<:NormalizedOPLayout ,SemiclassicalJacobiLayout} ) = copy (Ldiv {ApplyLayout{typeof(*)},SemiclassicalJacobiLayout} (L. A, L. B))
410
- copy (L:: Ldiv{SemiclassicalJacobiLayout,<:NormalizedOPLayout } ) = copy (Ldiv {SemiclassicalJacobiLayout,ApplyLayout{typeof(*)}} (L. A, L. B))
408
+ copy (L:: Ldiv{<:AbstractNormalizedOPLayout ,SemiclassicalJacobiLayout} ) = copy (Ldiv {ApplyLayout{typeof(*)},SemiclassicalJacobiLayout} (L. A, L. B))
409
+ copy (L:: Ldiv{SemiclassicalJacobiLayout,<:AbstractNormalizedOPLayout } ) = copy (Ldiv {SemiclassicalJacobiLayout,ApplyLayout{typeof(*)}} (L. A, L. B))
411
410
412
411
copy (L:: Ldiv{ApplyLayout{typeof(*)},SemiclassicalJacobiLayout} ) = copy (Ldiv {ApplyLayout{typeof(*)},BasisLayout} (L. A, L. B))
413
412
copy (L:: Ldiv{SemiclassicalJacobiLayout,ApplyLayout{typeof(*)}} ) = copy (Ldiv {BasisLayout,ApplyLayout{typeof(*)}} (L. A, L. B))
@@ -419,6 +418,7 @@ copy(L::Ldiv{WeightedOPLayout,SemiclassicalJacobiLayout}) = copy(Ldiv{WeightedOP
419
418
copy (L:: Ldiv{SemiclassicalJacobiLayout,WeightedOPLayout} ) = copy (Ldiv {BasisLayout,WeightedOPLayout} (L. A, L. B))
420
419
421
420
421
+ simplifiable (L:: Ldiv{SemiclassicalJacobiLayout,<:AbstractBasisLayout} ) = Val (true )
422
422
copy (L:: Ldiv{SemiclassicalJacobiLayout} ) = semijacobi_ldiv (L. A, L. B)
423
423
copy (L:: Ldiv{SemiclassicalJacobiLayout,<:AbstractBasisLayout} ) = semijacobi_ldiv (L. A, L. B)
424
424
copy (L:: Ldiv{SemiclassicalJacobiLayout,BroadcastLayout{typeof(*)}} ) = semijacobi_ldiv (L. A, L. B)
@@ -435,25 +435,25 @@ function copy(L::Ldiv{SemiclassicalJacobiLayout,SemiclassicalJacobiLayout})
435
435
(inv (M_Q) * L' ) * M_P
436
436
end
437
437
438
- function \ (A:: SemiclassicalJacobi , B:: SemiclassicalJacobi{T} ) where {T}
438
+ function \ (A:: SemiclassicalJacobi , B:: SemiclassicalJacobi{T} ) where {T}
439
439
if A. b == - 1 && B. b ≠ - 1
440
- return UpperTriangular (ApplyArray (inv, B \ A))
440
+ return UpperTriangular (ApplyArray (inv, B \ A))
441
441
elseif B. b == - 1 && A. b ≠ - 1
442
442
# First convert Bᵗᵃ⁻¹ᶜ into Bᵗᵃ⁰ᶜ
443
- Bᵗᵃ⁰ᶜ = SemiclassicalJacobi (B. t, B. a, zero (B. b), B. c, A)
443
+ Bᵗᵃ⁰ᶜ = SemiclassicalJacobi (B. t, B. a, zero (B. b), B. c, A)
444
444
Bᵗᵃ¹ᶜ = SemiclassicalJacobi (B. t, B. a, one (B. a), B. c, A)
445
445
Rᵦₐ₁ᵪᵗᵃ⁰ᶜ = Weighted (Bᵗᵃ⁰ᶜ) \ Weighted (Bᵗᵃ¹ᶜ)
446
446
b1 = Rᵦₐ₁ᵪᵗᵃ⁰ᶜ[band (0 )]
447
447
b0 = Vcat (one (T), Rᵦₐ₁ᵪᵗᵃ⁰ᶜ[band (- 1 )])
448
448
Rᵦₐ₋₁ᵪᵗᵃ⁰ᶜ = Bidiagonal (b0, b1, :U )
449
- # Then convert Bᵗᵃ⁰ᶜ into A and complete
449
+ # Then convert Bᵗᵃ⁰ᶜ into A and complete
450
450
Rₐ₀ᵪᴬ = UpperTriangular (A \ Bᵗᵃ⁰ᶜ)
451
451
return ApplyArray (* , Rₐ₀ᵪᴬ, Rᵦₐ₋₁ᵪᵗᵃ⁰ᶜ)
452
452
elseif A. b == B. b == - 1
453
453
Bᵗᵃ¹ᶜ = SemiclassicalJacobi (B. t, B. a, one (B. b), B. c, B)
454
454
Aᵗᵃ¹ᶜ = SemiclassicalJacobi (A. t, A. a, one (A. b), A. c, A)
455
455
Rₐ₁ᵪᵗᵘ¹ᵛ = Aᵗᵃ¹ᶜ \ Bᵗᵃ¹ᶜ
456
- # Make 1 ⊕ Rₐ₁ᵪᵗᵘ¹ᵛ
456
+ # Make 1 ⊕ Rₐ₁ᵪᵗᵘ¹ᵛ
457
457
V = eltype (Rₐ₁ᵪᵗᵘ¹ᵛ)
458
458
Rₐ₋₁ᵪᵗᵘ⁻¹ᵛ = Vcat (
459
459
Hcat (one (V), Zeros {V} (1 , ∞)),
@@ -464,8 +464,8 @@ function \(A::SemiclassicalJacobi, B::SemiclassicalJacobi{T}) where {T}
464
464
return semijacobi_ldiv (A, B)
465
465
end
466
466
end
467
- \ (A:: LanczosPolynomial , B:: SemiclassicalJacobi ) = semijacobi_ldiv (A, B)
468
- \ (A:: SemiclassicalJacobi , B:: LanczosPolynomial ) = semijacobi_ldiv (A, B)
467
+ \ (A:: ConvertedOrthogonalPolynomial , B:: SemiclassicalJacobi ) = semijacobi_ldiv (A, B)
468
+ \ (A:: SemiclassicalJacobi , B:: ConvertedOrthogonalPolynomial ) = semijacobi_ldiv (A, B)
469
469
function \ (w_A:: WeightedSemiclassicalJacobi{T} , w_B:: WeightedSemiclassicalJacobi{T} ) where T
470
470
wA,A = w_A. args
471
471
wB,B = w_B. args
@@ -479,12 +479,12 @@ function \(w_A::WeightedSemiclassicalJacobi{T}, w_B::WeightedSemiclassicalJacobi
479
479
@assert A. a + 1 == B. a && A. c + 1 == B. c
480
480
Q = SemiclassicalJacobi (B. t, B. a, one (B. b), B. c, B)
481
481
P = SemiclassicalJacobi (A. t, A. a, one (A. b), A. c, A)
482
- wP = Weighted (P)
482
+ wP = Weighted (P)
483
483
wQ = Weighted (Q)
484
484
R22 = wP \ wQ
485
485
α, β = _linear_coefficients (P. t, P. a, P. b, P. c)
486
- ℓ₁ = A. t - 1
487
- ℓ₂ = 1 + α - A. t
486
+ ℓ₁ = A. t - 1
487
+ ℓ₂ = 1 + α - A. t
488
488
ℓ₃ = inv (β)
489
489
d0 = Vcat (ℓ₁, R22[band (0 )])
490
490
d1 = Vcat (ℓ₂, R22[band (- 1 )])
@@ -505,13 +505,13 @@ function \(w_A::WeightedSemiclassicalJacobi{T}, w_B::WeightedSemiclassicalJacobi
505
505
elseif wA. a == wB. a && wA. b == wB. b && wA. c+ 1 == wB. c
506
506
@assert A. a == B. a && A. b == B. b && A. c+ 1 == B. c
507
507
- op_lowering (A,A. t)
508
- elseif wA. a+ 1 ≤ wB. a
508
+ elseif wA. a+ 1 ≤ wB. a
509
509
C = SemiclassicalJacobi (A. t, A. a+ 1 , A. b, A. c, A)
510
510
w_C = SemiclassicalJacobiWeight (wA. t, wA. a+ 1 , wA. b, wA. c) .* C
511
511
L_2 = w_C \ w_B
512
512
L_1 = w_A \ w_C
513
513
L_1 * L_2
514
- elseif wA. b+ 1 ≤ wB. b
514
+ elseif wA. b+ 1 ≤ wB. b
515
515
C = SemiclassicalJacobi (A. t, A. a, A. b+ 1 , A. c, A)
516
516
w_C = SemiclassicalJacobiWeight (wA. t, wA. a, wA. b+ 1 , wA. c) .* C
517
517
L_2 = w_C \ w_B
@@ -529,19 +529,19 @@ end
529
529
\ (w_A:: Weighted{<:Any,<:SemiclassicalJacobi} , w_B:: Weighted{<:Any,<:SemiclassicalJacobi} ) = convert (WeightedBasis, w_A) \ convert (WeightedBasis, w_B)
530
530
531
531
function \ (w_A:: HalfWeighted{lr, T, <:SemiclassicalJacobi} , B:: AbstractQuasiArray{V} ) where {lr, T, V}
532
- WP = convert (WeightedBasis, w_A)
533
- w_A. P. b ≠ - 1 && return WP \ B # no need to special case here
532
+ WP = convert (WeightedBasis, w_A)
533
+ w_A. P. b ≠ - 1 && return WP \ B # no need to special case here
534
534
! iszero (WP. args[1 ]. b) && throw (ArgumentError (" Cannot expand in a weighted basis including 1/(1-x)." ))
535
- # To expand f(x) = w(x)P(x)𝐟, note that P = [1 (1-x)Q] so
535
+ # To expand f(x) = w(x)P(x)𝐟, note that P = [1 (1-x)Q] so
536
536
# f(x) = w(x)[1 (1-x)Q(x)][f₀; 𝐟₁] = w(x)f₀ + w(x)(1-x)Q(x)𝐟₁. Thus,
537
- # f(1) = w(1)f₀ ⟹ f₀ = f(1) / w(1)
538
- # Then, f(x) - w(x)f₀ = w(x)(1-x)Q(x)𝐟₁, so that 𝐟₁ is just the expansion of
537
+ # f(1) = w(1)f₀ ⟹ f₀ = f(1) / w(1)
538
+ # Then, f(x) - w(x)f₀ = w(x)(1-x)Q(x)𝐟₁, so that 𝐟₁ is just the expansion of
539
539
# f(x) - w(x)f₀ in the w(x)(1-x)Q(x) basis.
540
- w, P = WP. args
541
- f₀ = B[end ] / w[end ]
540
+ w, P = WP. args
541
+ f₀ = B[end ] / w[end ]
542
542
C = B - w * f₀
543
543
Q = SemiclassicalJacobiWeight (w. t, w. a, one (w. b), w. c) .* SemiclassicalJacobi (P. t, P. a, one (P. b), P. c, P)
544
- f = Q \ C
544
+ f = Q \ C
545
545
return Vcat (f₀, f)
546
546
end
547
547
@@ -563,8 +563,8 @@ function ldiv(Q::SemiclassicalJacobi, f::AbstractQuasiVector)
563
563
elseif isinteger (Q. a) && (isinteger (Q. b) && Q. b ≥ 0 ) && isinteger (Q. c) # (a,b,c) are integers -> use QR/Cholesky
564
564
R̃ = Normalized (jacobi (Q. b, Q. a, UnitInterval {T} ()))
565
565
return (Q \ SemiclassicalJacobi (Q. t, Q. a, Q. b, 0 )) * _p0 (R̃) * (R̃ \ f)
566
- elseif isinteger (Q. a) && isone (- Q. b) && isinteger (Q. c)
567
- return semijacobi_ldiv (Q, f) # jacobi(< 0, Q.a) fails in the method above. jacobi(-1, 0) also leads to NaNs in coefficients
566
+ elseif isinteger (Q. a) && isone (- Q. b) && isinteger (Q. c)
567
+ return semijacobi_ldiv (Q, f) # jacobi(< 0, Q.a) fails in the method above. jacobi(-1, 0) also leads to NaNs in coefficients
568
568
else # fallback to Lanzcos
569
569
R̃ = toclassical (SemiclassicalJacobi (Q. t, mod (Q. a,- 1 ), mod (Q. b,- 1 ), mod (Q. c,- 1 )))
570
570
return (Q \ R̃) * (R̃ \ f)
@@ -639,7 +639,7 @@ function SemiclassicalJacobiFamily{T}(data::Vector, t, a, b, c) where T
639
639
end
640
640
641
641
function _getsecondifpossible (v)
642
- length (v) > 1 && return v[2 ]
642
+ length (v) > 1 && return v[2 ]
643
643
return v[1 ]
644
644
end
645
645
651
651
652
652
Base. broadcasted (:: Type{SemiclassicalJacobi} , t:: Number , a:: Number , b:: Number , c:: Number ) = SemiclassicalJacobi (t, a, b, c)
653
653
Base. broadcasted (:: Type{SemiclassicalJacobi{T}} , t:: Number , a:: Number , b:: Number , c:: Number ) where T = SemiclassicalJacobi {T} (t, a, b, c)
654
- Base. broadcasted (:: Type{SemiclassicalJacobi} , t:: Number , a:: Union{AbstractUnitRange,Number} , b:: Union{AbstractUnitRange,Number} , c:: Union{AbstractUnitRange,Number} ) =
654
+ Base. broadcasted (:: Type{SemiclassicalJacobi} , t:: Number , a:: Union{AbstractUnitRange,Number} , b:: Union{AbstractUnitRange,Number} , c:: Union{AbstractUnitRange,Number} ) =
655
655
SemiclassicalJacobiFamily (t, a, b, c)
656
- Base. broadcasted (:: Type{SemiclassicalJacobi{T}} , t:: Number , a:: Union{AbstractUnitRange,Number} , b:: Union{AbstractUnitRange,Number} , c:: Union{AbstractUnitRange,Number} ) where T =
656
+ Base. broadcasted (:: Type{SemiclassicalJacobi{T}} , t:: Number , a:: Union{AbstractUnitRange,Number} , b:: Union{AbstractUnitRange,Number} , c:: Union{AbstractUnitRange,Number} ) where T =
657
657
SemiclassicalJacobiFamily {T} (t, a, b, c)
658
658
659
659
@@ -664,7 +664,7 @@ function LazyArrays.cache_filldata!(P::SemiclassicalJacobiFamily, inds::Abstract
664
664
t,a,b,c = P. t,P. a,P. b,P. c
665
665
isrange = P. b isa AbstractUnitRange
666
666
for k in inds
667
- # If P.data[k-2] is not normalised (aka b = -1), cholesky fails. With the current design, this is only a problem if P.b
667
+ # If P.data[k-2] is not normalised (aka b = -1), cholesky fails. With the current design, this is only a problem if P.b
668
668
# is a range since we can translate between polynomials that both have b = -1.
669
669
Pprev = (isrange && P. b[k- 2 ] == - 1 ) ? P. data[k- 1 ] : P. data[k- 2 ] # isrange && P.b[k-2] == -1 could also be !isnormalized(P.data[k-2])
670
670
P. data[k] = SemiclassicalJacobi (t, _broadcast_getindex (a,k), _broadcast_getindex (b,k), _broadcast_getindex (c,k), Pprev)
@@ -704,7 +704,7 @@ function SemiclassicalJacobiCWeightFamily{T}(t::Number, a::Number, b::Number, c:
704
704
return SemiclassicalJacobiCWeightFamily {T} (SemiclassicalJacobiWeight .(t,a: a,b: b,c), t, a, b, c)
705
705
end
706
706
707
- Base. broadcasted (:: Type{SemiclassicalJacobiWeight} , t:: Number , a:: Number , b:: Number , c:: Union{AbstractUnitRange,Number} ) =
707
+ Base. broadcasted (:: Type{SemiclassicalJacobiWeight} , t:: Number , a:: Number , b:: Number , c:: Union{AbstractUnitRange,Number} ) =
708
708
SemiclassicalJacobiCWeightFamily (t, a, b, c)
709
709
710
710
_unweightedsemiclassicalsum (a,b,c,t) = pFq ((a+ 1 ,- c),(a+ b+ 2 , ), 1 / t)
@@ -714,7 +714,7 @@ function Base.broadcasted(::typeof(sum), W::SemiclassicalJacobiCWeightFamily{T})
714
714
cmin = minimum (c); cmax = maximum (c);
715
715
@assert isinteger (cmax) && isinteger (cmin)
716
716
# This is needed at high parameter values.
717
- # Manually setting setprecision(2048) allows accurate computation even for very high c.
717
+ # Manually setting setprecision(2048) allows accurate computation even for very high c.
718
718
t,a,b = convert (BigFloat,t),convert (BigFloat,a),convert (BigFloat,b)
719
719
F = zeros (BigFloat,cmax+ 1 )
720
720
F[1 ] = _unweightedsemiclassicalsum (a,b,0 ,t) # c=0
0 commit comments