Skip to content

Commit f9b395c

Browse files
latexify docs
1 parent e510b31 commit f9b395c

File tree

5 files changed

+88
-42
lines changed

5 files changed

+88
-42
lines changed

docs/src/index.md

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,30 @@ paduapoints
5151

5252
## Internal Methods
5353

54+
```@docs
55+
FastTransforms.half
56+
```
57+
58+
```@docs
59+
FastTransforms.two
60+
```
61+
62+
```@docs
63+
FastTransforms.δ
64+
```
65+
66+
```@docs
67+
FastTransforms.Λ
68+
```
69+
70+
```@docs
71+
FastTransforms.pochhammer
72+
```
73+
74+
```@docs
75+
FastTransforms.stirlingseries
76+
```
77+
5478
```@docs
5579
FastTransforms.clenshawcurtis
5680
```
@@ -76,25 +100,33 @@ FastTransforms.fejerweights2
76100
```
77101

78102
```@docs
79-
FastTransforms.half
103+
FastTransforms.chebyshevjacobimoments1
80104
```
81105

82106
```@docs
83-
FastTransforms.two
107+
FastTransforms.chebyshevjacobimoments2
84108
```
85109

86110
```@docs
87-
FastTransforms.δ
111+
FastTransforms.incrementα!
88112
```
89113

90114
```@docs
91-
FastTransforms.Λ
115+
FastTransforms.incrementβ!
92116
```
93117

94118
```@docs
95-
FastTransforms.pochhammer
119+
FastTransforms.incrementαβ!
96120
```
97121

98122
```@docs
99-
FastTransforms.stirlingseries
123+
FastTransforms.decrementα!
124+
```
125+
126+
```@docs
127+
FastTransforms.decrementβ!
128+
```
129+
130+
```@docs
131+
FastTransforms.decrementαβ!
100132
```

src/PaduaTransform.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Inverse Padua Transform maps the 2D Chebyshev coefficients to the values of the
4141
ipaduatransform(v::AbstractVector,lex...) = plan_ipaduatransform!(v,lex...)*copy(v)
4242

4343
doc"""
44-
Creates (n+2)x(n+1) Chebyshev coefficient matrix from triangle coefficients.
44+
Creates ``(n+2)x(n+1)`` Chebyshev coefficient matrix from triangle coefficients.
4545
"""
4646
function trianglecfsmat(P::IPaduaTransformPlan{true},cfs::AbstractVector)
4747
N=length(cfs)
@@ -146,7 +146,7 @@ Padua Transform maps from interpolant values at the Padua points to the 2D Cheby
146146
paduatransform(v::AbstractVector,lex...) = plan_paduatransform!(v,lex...)*copy(v)
147147

148148
doc"""
149-
Creates (n+2)x(n+1) matrix of interpolant values on the tensor grid at the (n+1)(n+2)/2 Padua points.
149+
Creates ``(n+2)x(n+1)`` matrix of interpolant values on the tensor grid at the ``(n+1)(n+2)/2`` Padua points.
150150
"""
151151
function paduavalsmat(P::PaduaTransformPlan,v::AbstractVector)
152152
N=length(v)
@@ -166,7 +166,7 @@ function paduavalsmat(P::PaduaTransformPlan,v::AbstractVector)
166166
end
167167

168168
doc"""
169-
Creates length (n+1)(n+2)/2 vector from matrix of triangle Chebyshev coefficients.
169+
Creates length ``(n+1)(n+2)/2`` vector from matrix of triangle Chebyshev coefficients.
170170
"""
171171
function trianglecfsvec!(v,P::PaduaTransformPlan{true},cfs::Matrix)
172172
m=size(cfs,2)
@@ -195,7 +195,7 @@ function trianglecfsvec!(v,P::PaduaTransformPlan{false},cfs::Matrix)
195195
end
196196

197197
doc"""
198-
Returns coordinates of the (n+1)(n+2)/2 Padua points.
198+
Returns coordinates of the ``(n+1)(n+2)/2`` Padua points.
199199
"""
200200
function paduapoints{T}(::Type{T},n::Integer)
201201
N=div((n+1)*(n+2),2)

src/cjt.jl

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -114,25 +114,31 @@ end
114114

115115
doc"""
116116
Computes the Chebyshev expansion coefficients
117-
given the Jacobi expansion coefficients ``c`` with parameters ``α`` and ``β``.
117+
given the Jacobi expansion coefficients ``c`` with parameters ``\alpha`` and ``\beta``:
118118
119-
See also [`icjt`](#method__icjt.1) and [`jjt`](#method__jjt.1).
119+
```math
120+
{\rm CJT} : \sum_{n=0}^N c_n^{\rm jac}P_n^{(\alpha,\beta)}(x) \to \sum_{n=0}^N c_n^{\rm cheb}T_n(x).
121+
```
120122
"""
121123
cjt(c,α,β) = plan_cjt(c,α,β)*c
122124

123125
doc"""
124-
Computes the Jacobi expansion coefficients with parameters ``α`` and ``β``
125-
given the Chebyshev expansion coefficients ``c``.
126+
Computes the Jacobi expansion coefficients with parameters ``\alpha`` and ``\beta``
127+
given the Chebyshev expansion coefficients ``c``:
126128
127-
See also [`cjt`](#method__cjt.1) and [`jjt`](#method__jjt.1).
129+
```math
130+
{\rm iCJT} : \sum_{n=0}^N c_n^{\rm cheb}T_n(x) \to \sum_{n=0}^N c_n^{\rm jac}P_n^{(\alpha,\beta)}(x).
131+
```
128132
"""
129133
icjt(c,α,β) = plan_icjt(c,α,β)*c
130134

131135
doc"""
132-
Computes the Jacobi expansion coefficients with parameters ``γ`` and ``δ``
133-
given the Jacobi expansion coefficients ``c`` with parameters ``α`` and ``β``.
136+
Computes the Jacobi expansion coefficients with parameters ``\gamma`` and ``\delta``
137+
given the Jacobi expansion coefficients ``c`` with parameters ``\alpha`` and ``\beta``:
134138
135-
See also [`cjt`](#method__cjt.1) and [`icjt`](#method__icjt.1).
139+
```math
140+
{\rm JJT} : \sum_{n=0}^N c_n^{\rm jac}P_n^{(\alpha,\beta)}(x) \to \sum_{n=0}^N c_n^{\rm jac}P_n^{(\gamma,\delta)}(x).
141+
```
136142
"""
137143
function jjt(c,α,β,γ,δ)
138144
if isapprox(α,γ) && isapprox(β,δ)
@@ -149,7 +155,7 @@ arrays, normalization constants, and recurrence coefficients for a forward Cheby
149155
150156
``c`` is the vector of coefficients; and,
151157
152-
``α`` and ``β`` are the Jacobi parameters.
158+
``\alpha`` and ``\beta`` are the Jacobi parameters.
153159
154160
Optionally:
155161
@@ -163,7 +169,7 @@ arrays, normalization constants, and recurrence coefficients for an inverse Cheb
163169
164170
``c`` is the vector of coefficients; and,
165171
166-
``α`` and ``β`` are the Jacobi parameters.
172+
``\alpha`` and ``\beta`` are the Jacobi parameters.
167173
168174
Optionally:
169175

src/gaunt.jl

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
doc"""
22
Calculates the Gaunt coefficients, defined by:
33
4-
a(m,n,μ,ν,q) = (2(n+ν-2q)+1)/2 (n+ν-2q-m-μ)!/(n+ν-2q+m+μ)! ∫₋₁⁺¹ P_m^n(x) P_ν^μ(x) P_{n+ν-2q}^{m+μ}(x) dx.
5-
4+
```math
5+
a(m,n,\mu,\nu,q) = \frac{2(n+\nu-2q)+1}{2} \frac{(n+\nu-2q-m-\mu)!}{(n+\nu-2q+m+\mu)!} \int_{-1}^{+1} P_m^n(x) P_\nu^\mu(x) P_{n+\nu-2q}^{m+\mu}(x) {\rm\,d}x.
6+
```
67
or defined by:
78
8-
P_n^m(x) P_ν^μ(x) = ∑_{q=0}^{q_{max}} a(m,n,μ,ν,q) P_{n+ν-2q}^{m+μ}(x)
9+
```math
10+
P_n^m(x) P_\nu^\mu(x) = \sum_{q=0}^{q_{\rm max}} a(m,n,\mu,\nu,q) P_{n+\nu-2q}^{m+\mu}(x)
11+
```
912
1013
This is a Julia implementation of the stable recurrence described in:
1114
12-
Y.-l. Xu, "Fast evaluation of Gaunt coefficients: recursive approach", J. Comp. Appl. Math., 85:53–65, 1997.
15+
Y.-l. Xu, Fast evaluation of Gaunt coefficients: recursive approach, *J. Comp. Appl. Math.*, **85**:53–65, 1997.
1316
"""
1417
function gaunt{T}(::Type{T},m::Int,n::Int::Int::Int;normalized::Bool=false)
1518
if normalized

src/specialfunctions.jl

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,17 @@ two(x::Number) = oftype(x,2)
2121
two{T<:Number}(::Type{T}) = convert(T,2)
2222

2323
doc"""
24-
The Kronecker δ function.
24+
The Kronecker ``\delta`` function:
25+
26+
```math
27+
\delta_{k,j} = \left\{\begin{array}{ccc} 1 & {\rm for} & k = j,\\ 0 & {\rm for} & k \ne j.\end{array}\right.
28+
```
2529
"""
2630
δ(k::Integer,j::Integer) = k == j ? 1 : 0
2731

2832

2933
doc"""
30-
Pochhammer symbol $(x)_n = \frac{\Gamma(x+n)}{\Gamma(x)}$ for the rising factorial.
34+
Pochhammer symbol ``(x)_n = \frac{\Gamma(x+n)}{\Gamma(x)}`` for the rising factorial.
3135
"""
3236
function pochhammer(x::Number,n::Integer)
3337
ret = one(x)
@@ -58,7 +62,7 @@ function pochhammer{T<:Real}(x::Number,n::UnitRange{T})
5862
end
5963

6064
doc"""
61-
Stirling series for Γ(z).
65+
Stirling's asymptotic series for ``\Gamma(z)``.
6266
"""
6367
stirlingseries(z) = gamma(z)*sqrt((z/π)/2)*exp(z)/z^z
6468

@@ -136,13 +140,13 @@ Anαβ{T<:Integer}(n::AbstractMatrix{T},α::Number,β::Number) = [ Anαβ(n[i,j]
136140

137141

138142
doc"""
139-
The Lambda function Λ(z) = Γ(z+½)/Γ(z+1) for the ratio of gamma functions.
143+
The Lambda function ``\Lambda(z) = \frac{\Gamma(z+\frac{1}{2})}{\Gamma(z+1)}`` for the ratio of gamma functions.
140144
"""
141145
Λ(z::Number) = exp(lgamma(z+half(z))-lgamma(z+one(z)))
142146
doc"""
143-
For 64-bit floating-point arithmetic, the Lambda function uses the asymptotic series for τ in Appendix B of
147+
For 64-bit floating-point arithmetic, the Lambda function uses the asymptotic series for ``\tau`` in Appendix B of
144148
145-
I. Bogaert and B. Michiels and J. Fostier, 𝒪(1) computation of Legendre polynomials and Gauss–Legendre nodes and weights for parallel computing, SIAM J. Sci. Comput., 34:C83–C101, 2012.
149+
I. Bogaert and B. Michiels and J. Fostier, 𝒪(1) computation of Legendre polynomials and Gauss–Legendre nodes and weights for parallel computing, *SIAM J. Sci. Comput.*, **34**:C83–C101, 2012.
146150
"""
147151
function Λ(x::Float64)
148152
if x > 9.84475
@@ -153,9 +157,8 @@ function Λ(x::Float64)
153157
end
154158
end
155159

156-
157160
doc"""
158-
The Lambda function Λ(z,λ₁,λ₂) = Γ(z+λ₁)/Γ(z+λ₂) for the ratio of gamma functions.
161+
The Lambda function ``\Lambda(z,λ₁,λ₂) = \frac{\Gamma(z+\lambda_1)}{Γ(z+\lambda_2)}`` for the ratio of gamma functions.
159162
"""
160163
Λ(z::Number,λ₁::Number,λ₂::Number) = exp(lgamma(z+λ₁)-lgamma(z+λ₂))
161164
function Λ(x::Float64,λ₁::Float64,λ₂::Float64)
@@ -393,8 +396,9 @@ end
393396
doc"""
394397
Modified Chebyshev moments of the first kind with respect to the Jacobi weight:
395398
396-
∫₋₁⁺¹ T_n(x) (1-x)^α(1+x)^β dx.
397-
399+
```math
400+
\int_{-1}^{+1} T_n(x) (1-x)^\alpha(1+x)^\beta{\rm\,d}x.
401+
```
398402
"""
399403
function chebyshevjacobimoments1{T<:AbstractFloat}(N::Int::T::T)
400404
μ = zeros(T,N)
@@ -411,8 +415,9 @@ end
411415
doc"""
412416
Modified Chebyshev moments of the second kind with respect to the Jacobi weight:
413417
414-
∫₋₁⁺¹ U_n(x) (1-x)^α(1+x)^β dx.
415-
418+
```math
419+
\int_{-1}^{+1} U_n(x) (1-x)^\alpha(1+x)^\beta{\rm\,d}x.
420+
```
416421
"""
417422
function chebyshevjacobimoments2{T<:AbstractFloat}(N::Int::T::T)
418423
μ = zeros(T,N)
@@ -427,7 +432,7 @@ function chebyshevjacobimoments2{T<:AbstractFloat}(N::Int,α::T,β::T)
427432
end
428433

429434
doc"""
430-
Compute Jacobi expansion coefficients in Pₙ^(α+1,β) given Jacobi expansion coefficients in Pₙ^(α,β) in-place.
435+
Compute Jacobi expansion coefficients in ``P_n^{(\alpha+1,\beta)}(x)`` given Jacobi expansion coefficients in ``P_n^{(\alpha,\beta)}(x)`` in-place.
431436
"""
432437
function incrementα!(c::AbstractVector,α,β)
433438
αβ,N = α+β,length(c)
@@ -438,7 +443,7 @@ function incrementα!(c::AbstractVector,α,β)
438443
end
439444

440445
doc"""
441-
Compute Jacobi expansion coefficients in Pₙ^(α,β+1) given Jacobi expansion coefficients in Pₙ^(α,β) in-place.
446+
Compute Jacobi expansion coefficients in ``P_n^{(\alpha,\beta+1)}(x)`` given Jacobi expansion coefficients in ``P_n^{(\alpha,\beta)}(x)`` in-place.
442447
"""
443448
function incrementβ!(c::AbstractVector,α,β)
444449
αβ,N = α+β,length(c)
@@ -449,7 +454,7 @@ function incrementβ!(c::AbstractVector,α,β)
449454
end
450455

451456
doc"""
452-
Compute Jacobi expansion coefficients in Pₙ^(α+1,α+1) given Jacobi expansion coefficients in Pₙ^(α,α) in-place.
457+
Compute Jacobi expansion coefficients in ``P_n^{(\alpha+1,\alpha+1)}(x)`` given Jacobi expansion coefficients in ``P_n^{(\alpha,\alpha)}(x)`` in-place.
453458
"""
454459
function incrementαβ!(c::AbstractVector,α,β)
455460
@assert α == β
@@ -462,7 +467,7 @@ function incrementαβ!(c::AbstractVector,α,β)
462467
end
463468

464469
doc"""
465-
Compute Jacobi expansion coefficients in Pₙ^(α-1,β) given Jacobi expansion coefficients in Pₙ^(α,β) in-place.
470+
Compute Jacobi expansion coefficients in ``P_n^{(\alpha-1,\beta)}(x)`` given Jacobi expansion coefficients in ``P_n^{(\alpha,\beta)}(x)`` in-place.
466471
"""
467472
function decrementα!(c::AbstractVector,α,β)
468473
αβ,N = α+β,length(c)
@@ -473,7 +478,7 @@ function decrementα!(c::AbstractVector,α,β)
473478
end
474479

475480
doc"""
476-
Compute Jacobi expansion coefficients in Pₙ^(α,β-1) given Jacobi expansion coefficients in Pₙ^(α,β) in-place.
481+
Compute Jacobi expansion coefficients in ``P_n^{(\alpha,\beta-1)}(x)`` given Jacobi expansion coefficients in ``P_n^{(\alpha,\beta)}(x)`` in-place.
477482
"""
478483
function decrementβ!(c::AbstractVector,α,β)
479484
αβ,N = α+β,length(c)
@@ -484,7 +489,7 @@ function decrementβ!(c::AbstractVector,α,β)
484489
end
485490

486491
doc"""
487-
Compute Jacobi expansion coefficients in Pₙ^(α-1,α-1) given Jacobi expansion coefficients in Pₙ^(α,α) in-place.
492+
Compute Jacobi expansion coefficients in ``P_n^{(\alpha-1,\alpha-1)}(x)`` given Jacobi expansion coefficients in ``P_n^{(\alpha,\alpha)}(x)`` in-place.
488493
"""
489494
function decrementαβ!(c::AbstractVector,α,β)
490495
@assert α == β

0 commit comments

Comments
 (0)