Skip to content

Commit 28b78cb

Browse files
authored
Use a better method for the derivative of the $b = -1$ polynomials (#122)
* Just use the half-weighted formula * More efficient * use latest * Update ci.yml * Update Project.toml
1 parent ddebef5 commit 28b78cb

File tree

4 files changed

+11
-13
lines changed

4 files changed

+11
-13
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ jobs:
2020
fail-fast: false
2121
matrix:
2222
version:
23-
- '1.10'
23+
- '1'
24+
- 'lts'
25+
- 'pre'
2426
os:
2527
- ubuntu-latest
2628
- macOS-latest

Project.toml

Lines changed: 1 addition & 1 deletion
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.5.8"
4+
version = "0.5.9"
55

66
[deps]
77
ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"

src/SemiclassicalOrthogonalPolynomials.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import InfiniteArrays: OneToInf, InfUnitRange
1818
import ContinuumArrays: basis, Weight, @simplify, AbstractBasisLayout, BasisLayout, MappedBasisLayout, grid, plotgrid, equals_layout, ExpansionLayout
1919
import FillArrays: SquareEye
2020
import HypergeometricFunctions: _₂F₁general2
21-
import InfiniteLinearAlgebra: BidiagonalConjugation
2221

2322
export LanczosPolynomial, Legendre, Normalized, normalize, SemiclassicalJacobi, SemiclassicalJacobiWeight, WeightedSemiclassicalJacobi, OrthogonalPolynomialRatio
2423

src/derivatives.jl

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,13 @@ function diff(P::SemiclassicalJacobi{T}; dims=1) where {T}
4949
Q = SemiclassicalJacobi(P.t, P.a+1,P.b+1,P.c+1,P)
5050
Q * divdiff(Q, P)
5151
elseif P.b == -1
52-
Pᵗᵃ⁰ᶜ = SemiclassicalJacobi(P.t, P.a, zero(P.b), P.c)
53-
Pᵗᵃ¹ᶜ = SemiclassicalJacobi(P.t, P.a, one(P.b), P.c, Pᵗᵃ⁰ᶜ)
54-
Rᵦₐ₁ᵪᵗᵃ⁰ᶜ = Weighted(Pᵗᵃ⁰ᶜ) \ Weighted(Pᵗᵃ¹ᶜ)
55-
Dₐ₀ᵪᵃ⁺¹¹ᶜ⁺¹ = diff(Pᵗᵃ⁰ᶜ)
56-
Pᵗᵃ⁺¹¹ᶜ⁺¹ = Dₐ₀ᵪᵃ⁺¹¹ᶜ⁺¹.args[1]
57-
Pᵗᵃ⁺¹⁰ᶜ⁺¹ = SemiclassicalJacobi(P.t, P.a + 1, zero(P.b), P.c + 1, Pᵗᵃ⁰ᶜ)
58-
Rₐ₊₁₀ᵪ₊₁ᵗᵃ⁺¹¹ᶜ⁺¹ = Pᵗᵃ⁺¹¹ᶜ⁺¹ \ Pᵗᵃ⁺¹⁰ᶜ⁺¹
59-
Dₐ₋₁ᵪᵃ⁺¹⁰ᶜ⁺¹ = BidiagonalConjugation(Rₐ₊₁₀ᵪ₊₁ᵗᵃ⁺¹¹ᶜ⁺¹, coefficients(Dₐ₀ᵪᵃ⁺¹¹ᶜ⁺¹), Rᵦₐ₁ᵪᵗᵃ⁰ᶜ, 'U')
60-
b2 = Vcat(zero(T), zero(T), supdiagonaldata(Dₐ₋₁ᵪᵃ⁺¹⁰ᶜ⁺¹))
61-
b1 = Vcat(zero(T), diagonaldata(Dₐ₋₁ᵪᵃ⁺¹⁰ᶜ⁺¹))
52+
P1 = SemiclassicalJacobi(P.t, P.a, one(P.b), P.c, P)
53+
WP1 = HalfWeighted{:b}(P1)
54+
D = diff(WP1)
55+
Pᵗᵃ⁺¹⁰ᶜ⁺¹ = D.args[1].P
56+
Dmat = D.args[2]
57+
b2 = Vcat(zero(T), zero(T), Dmat[band(1)])
58+
b1 = Vcat(zero(T), Dmat[band(0)])
6259
data = Hcat(b2, b1)'
6360
D = _BandedMatrix(data, ∞, -1, 2)
6461
return Pᵗᵃ⁺¹⁰ᶜ⁺¹ * D

0 commit comments

Comments
 (0)