Skip to content

Commit 2095e01

Browse files
add doc
1 parent 29589f0 commit 2095e01

File tree

7 files changed

+44
-39
lines changed

7 files changed

+44
-39
lines changed

src/PaduaTransform.jl

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""
1+
doc"""
22
Pre-plan an Inverse Padua Transform.
33
"""
44
# lex indicates if its lexigraphical (i.e., x, y) or reverse (y, x)
@@ -10,6 +10,9 @@ end
1010
IPaduaTransformPlan{T,lex}(cfsmat::Matrix{T},idctplan,::Type{Val{lex}}) =
1111
IPaduaTransformPlan{lex,typeof(idctplan),T}(cfsmat,idctplan)
1212

13+
doc"""
14+
Pre-plan an Inverse Padua Transform.
15+
"""
1316
function plan_ipaduatransform!{T}(::Type{T},N::Integer,lex)
1417
n=Int(cld(-3+sqrt(1+8N),2))
1518
if N div((n+1)*(n+2),2)
@@ -20,7 +23,6 @@ end
2023

2124

2225
plan_ipaduatransform!{T}(::Type{T},N::Integer) = plan_ipaduatransform!(T,N,Val{true})
23-
2426
plan_ipaduatransform!{T}(v::AbstractVector{T},lex...) = plan_ipaduatransform!(eltype(v),length(v),lex...)
2527

2628
function *{T}(P::IPaduaTransformPlan,v::AbstractVector{T})
@@ -33,12 +35,12 @@ function *{T}(P::IPaduaTransformPlan,v::AbstractVector{T})
3335
end
3436

3537
ipaduatransform!(v::AbstractVector,lex...) = plan_ipaduatransform!(v,lex...)*v
36-
"""
38+
doc"""
3739
Inverse Padua Transform maps the 2D Chebyshev coefficients to the values of the interpolation polynomial at the Padua points.
3840
"""
3941
ipaduatransform(v::AbstractVector,lex...) = plan_ipaduatransform!(v,lex...)*copy(v)
4042

41-
"""
43+
doc"""
4244
Creates (n+2)x(n+1) Chebyshev coefficient matrix from triangle coefficients.
4345
"""
4446
function trianglecfsmat(P::IPaduaTransformPlan{true},cfs::AbstractVector)
@@ -79,7 +81,7 @@ function trianglecfsmat(P::IPaduaTransformPlan{false},cfs::AbstractVector)
7981
return cfsmat
8082
end
8183

82-
"""
84+
doc"""
8385
Vectorizes the function values at the Padua points.
8486
"""
8587
function paduavec!(v,P::IPaduaTransformPlan,padmat::Matrix)
@@ -98,7 +100,7 @@ function paduavec!(v,P::IPaduaTransformPlan,padmat::Matrix)
98100
return v
99101
end
100102

101-
"""
103+
doc"""
102104
Pre-plan a Padua Transform.
103105
"""
104106
immutable PaduaTransformPlan{lex,DCTPLAN,T}
@@ -109,6 +111,9 @@ end
109111
PaduaTransformPlan{T,lex}(vals::Matrix{T},dctplan,::Type{Val{lex}}) =
110112
PaduaTransformPlan{lex,typeof(dctplan),T}(vals,dctplan)
111113

114+
doc"""
115+
Pre-plan a Padua Transform.
116+
"""
112117
function plan_paduatransform!{T}(::Type{T},N::Integer,lex)
113118
n=Int(cld(-3+sqrt(1+8N),2))
114119
if N  ((n+1)*(n+2))÷2
@@ -135,12 +140,12 @@ function *{T}(P::PaduaTransformPlan,v::AbstractVector{T})
135140
end
136141

137142
paduatransform!(v::AbstractVector,lex...) = plan_paduatransform!(v,lex...)*v
138-
"""
143+
doc"""
139144
Padua Transform maps from interpolant values at the Padua points to the 2D Chebyshev coefficients.
140145
"""
141146
paduatransform(v::AbstractVector,lex...) = plan_paduatransform!(v,lex...)*copy(v)
142147

143-
"""
148+
doc"""
144149
Creates (n+2)x(n+1) matrix of interpolant values on the tensor grid at the (n+1)(n+2)/2 Padua points.
145150
"""
146151
function paduavalsmat(P::PaduaTransformPlan,v::AbstractVector)
@@ -160,7 +165,7 @@ function paduavalsmat(P::PaduaTransformPlan,v::AbstractVector)
160165
return vals
161166
end
162167

163-
"""
168+
doc"""
164169
Creates length (n+1)(n+2)/2 vector from matrix of triangle Chebyshev coefficients.
165170
"""
166171
function trianglecfsvec!(v,P::PaduaTransformPlan{true},cfs::Matrix)
@@ -189,7 +194,7 @@ function trianglecfsvec!(v,P::PaduaTransformPlan{false},cfs::Matrix)
189194
return v
190195
end
191196

192-
"""
197+
doc"""
193198
Returns coordinates of the (n+1)(n+2)/2 Padua points.
194199
"""
195200
function paduapoints{T}(::Type{T},n::Integer)

src/cjt.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,23 +112,23 @@ function *(p::FastTransformPlan,c::AbstractMatrix)
112112
end
113113

114114

115-
"""
115+
doc"""
116116
Computes the Chebyshev expansion coefficients
117117
given the Jacobi expansion coefficients ``c`` with parameters ``α`` and ``β``.
118118
119119
See also [`icjt`](#method__icjt.1) and [`jjt`](#method__jjt.1).
120120
"""
121121
cjt(c,α,β) = plan_cjt(c,α,β)*c
122122

123-
"""
123+
doc"""
124124
Computes the Jacobi expansion coefficients with parameters ``α`` and ``β``
125125
given the Chebyshev expansion coefficients ``c``.
126126
127127
See also [`cjt`](#method__cjt.1) and [`jjt`](#method__jjt.1).
128128
"""
129129
icjt(c,α,β) = plan_icjt(c,α,β)*c
130130

131-
"""
131+
doc"""
132132
Computes the Jacobi expansion coefficients with parameters ``γ`` and ``δ``
133133
given the Jacobi expansion coefficients ``c`` with parameters ``α`` and ``β``.
134134
@@ -143,7 +143,7 @@ function jjt(c,α,β,γ,δ)
143143
end
144144

145145

146-
"""
146+
doc"""
147147
Pre-plan optimized DCT-I and DST-I plans and pre-allocate the necessary
148148
arrays, normalization constants, and recurrence coefficients for a forward Chebyshev—Jacobi transform.
149149
@@ -157,7 +157,7 @@ Optionally:
157157
"""
158158
plan_cjt(c::AbstractVector,α,β;M::Int=7) = α == β ? plan_cjt(c,α+half(α);M=M) : ForwardChebyshevJacobiPlan(c,α,β,M)
159159

160-
"""
160+
doc"""
161161
Pre-plan optimized DCT-I and DST-I plans and pre-allocate the necessary
162162
arrays, normalization constants, and recurrence coefficients for an inverse Chebyshev—Jacobi transform.
163163

src/clenshawcurtis.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
clenshawcurtis_plan(μ) = length(μ) > 1 ? FFTW.plan_r2r!(μ, FFTW.REDFT00) : ones(μ)'
22

3-
"""
3+
doc"""
44
Compute nodes and weights of the Clenshaw—Curtis quadrature rule with a Jacobi weight.
55
"""
66
clenshawcurtis{T<:AbstractFloat}(N::Int::T::T) = clenshawcurtis(N,α,β,clenshawcurtis_plan(zeros(T,N)))
77
clenshawcurtis{T<:AbstractFloat}(N::Int::T::T,plan) = T[cospi(k/(N-one(T))) for k=0:N-1],clenshawcurtisweights(N,α,β,plan)
88

9-
"""
9+
doc"""
1010
Compute weights of the Clenshaw—Curtis quadrature rule with a Jacobi weight.
1111
"""
1212
clenshawcurtisweights{T<:AbstractFloat}(N::Int::T::T) = clenshawcurtisweights(N,α,β,clenshawcurtis_plan(zeros(T,N)))

src/fejer.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
fejer_plan1(μ) = FFTW.plan_r2r!(μ, FFTW.REDFT01)
22
fejer_plan2(μ) = FFTW.plan_r2r!(μ, FFTW.RODFT00)
33

4-
"""
4+
doc"""
55
Compute nodes and weights of Fejer's first quadrature rule with a Jacobi weight.
66
"""
77
fejer1{T<:AbstractFloat}(N::Int::T::T) = fejer1(N,α,β,fejer_plan1(zeros(T,N)))
88

9-
"""
9+
doc"""
1010
Compute nodes and weights of Fejer's second quadrature rule with a Jacobi weight.
1111
"""
1212
fejer2{T<:AbstractFloat}(N::Int::T::T) = fejer2(N,α,β,fejer_plan2(zeros(T,N)))
@@ -15,12 +15,12 @@ fejer1{T<:AbstractFloat}(N::Int,α::T,β::T,plan) = T[sinpi((N-2k-one(T))/2N) fo
1515
fejer2{T<:AbstractFloat}(N::Int::T::T,plan) = T[cospi((k+one(T))/(N+one(T))) for k=0:N-1],fejerweights2(N,α,β,plan)
1616

1717

18-
"""
18+
doc"""
1919
Compute weights of Fejer's first quadrature rule with a Jacobi weight.
2020
"""
2121
fejerweights1{T<:AbstractFloat}(N::Int::T::T) = fejerweights1(N,α,β,fejer_plan1(zeros(T,N)))
2222

23-
"""
23+
doc"""
2424
Compute weights of Fejer's second quadrature rule with a Jacobi weight.
2525
"""
2626
fejerweights2{T<:AbstractFloat}(N::Int::T::T) = fejerweights2(N,α,β,fejer_plan2(zeros(T,N)))

src/gaunt.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""
1+
doc"""
22
Calculates the Gaunt coefficients, defined by:
33
44
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.
@@ -18,7 +18,7 @@ function gaunt{T}(::Type{T},m::Int,n::Int,μ::Int,ν::Int;normalized::Bool=false
1818
scale!(normalization(T,m,n,μ,ν),gaunt(T,m,n,μ,ν;normalized=true))
1919
end
2020
end
21-
"""
21+
doc"""
2222
Calculates the Gaunt coefficients in 64-bit floating-point arithmetic.
2323
"""
2424
gaunt(m::Int,n::Int::Int::Int;kwds...) = gaunt(Float64,m,n,μ,ν;kwds...)

src/specialfunctions.jl

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,21 @@ const BACKWARD = false
66
const sqrtpi = 1.772453850905516027298
77
const edivsqrt2pi = 1.084437551419227546612
88

9-
"""
9+
doc"""
1010
Compute a typed 0.5.
1111
"""
1212
half(x::Number) = oftype(x,0.5)
1313
half(x::Integer) = half(float(x))
1414
half{T<:Number}(::Type{T}) = convert(T,0.5)
1515
half{T<:Integer}(::Type{T}) = half(AbstractFloat)
1616

17-
"""
17+
doc"""
1818
Compute a typed 2.
1919
"""
2020
two(x::Number) = oftype(x,2)
2121
two{T<:Number}(::Type{T}) = convert(T,2)
2222

23-
"""
23+
doc"""
2424
The Kronecker δ function.
2525
"""
2626
δ(k::Integer,j::Integer) = k == j ? 1 : 0
@@ -57,7 +57,7 @@ function pochhammer{T<:Real}(x::Number,n::UnitRange{T})
5757
ret
5858
end
5959

60-
"""
60+
doc"""
6161
Stirling series for Γ(z).
6262
"""
6363
stirlingseries(z) = gamma(z)*sqrt((z/π)/2)*exp(z)/z^z
@@ -135,11 +135,11 @@ Anαβ{T<:Integer}(n::AbstractVector{T},α::Number,β::Number) = [ Anαβ(n[i],
135135
Anαβ{T<:Integer}(n::AbstractMatrix{T}::Number::Number) = [ Anαβ(n[i,j],α,β) for i=1:size(n,1), j=1:size(n,2) ]
136136

137137

138-
"""
138+
doc"""
139139
The Lambda function Λ(z) = Γ(z+½)/Γ(z+1) for the ratio of gamma functions.
140140
"""
141141
Λ(z::Number) = exp(lgamma(z+half(z))-lgamma(z+one(z)))
142-
"""
142+
doc"""
143143
For 64-bit floating-point arithmetic, the Lambda function uses the asymptotic series for τ in Appendix B of
144144
145145
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.
@@ -154,7 +154,7 @@ function Λ(x::Float64)
154154
end
155155

156156

157-
"""
157+
doc"""
158158
The Lambda function Λ(z,λ₁,λ₂) = Γ(z+λ₁)/Γ(z+λ₂) for the ratio of gamma functions.
159159
"""
160160
Λ(z::Number,λ₁::Number,λ₂::Number) = exp(lgamma(z+λ₁)-lgamma(z+λ₂))
@@ -390,7 +390,7 @@ function init_c₁c₂!(c₁::Vector,c₂::Vector,u::Vector,v::Vector,c::Vector,
390390
end
391391

392392

393-
"""
393+
doc"""
394394
Modified Chebyshev moments of the first kind with respect to the Jacobi weight:
395395
396396
∫₋₁⁺¹ T_n(x) (1-x)^α(1+x)^β dx.
@@ -408,7 +408,7 @@ function chebyshevjacobimoments1{T<:AbstractFloat}(N::Int,α::T,β::T)
408408
μ
409409
end
410410

411-
"""
411+
doc"""
412412
Modified Chebyshev moments of the second kind with respect to the Jacobi weight:
413413
414414
∫₋₁⁺¹ U_n(x) (1-x)^α(1+x)^β dx.
@@ -426,7 +426,7 @@ function chebyshevjacobimoments2{T<:AbstractFloat}(N::Int,α::T,β::T)
426426
μ
427427
end
428428

429-
"""
429+
doc"""
430430
Compute Jacobi expansion coefficients in Pₙ^(α+1,β) given Jacobi expansion coefficients in Pₙ^(α,β) in-place.
431431
"""
432432
function incrementα!(c::AbstractVector,α,β)
@@ -437,7 +437,7 @@ function incrementα!(c::AbstractVector,α,β)
437437
c
438438
end
439439

440-
"""
440+
doc"""
441441
Compute Jacobi expansion coefficients in Pₙ^(α,β+1) given Jacobi expansion coefficients in Pₙ^(α,β) in-place.
442442
"""
443443
function incrementβ!(c::AbstractVector,α,β)
@@ -448,7 +448,7 @@ function incrementβ!(c::AbstractVector,α,β)
448448
c
449449
end
450450

451-
"""
451+
doc"""
452452
Compute Jacobi expansion coefficients in Pₙ^(α+1,α+1) given Jacobi expansion coefficients in Pₙ^(α,α) in-place.
453453
"""
454454
function incrementαβ!(c::AbstractVector,α,β)
@@ -461,7 +461,7 @@ function incrementαβ!(c::AbstractVector,α,β)
461461
c
462462
end
463463

464-
"""
464+
doc"""
465465
Compute Jacobi expansion coefficients in Pₙ^(α-1,β) given Jacobi expansion coefficients in Pₙ^(α,β) in-place.
466466
"""
467467
function decrementα!(c::AbstractVector,α,β)
@@ -472,7 +472,7 @@ function decrementα!(c::AbstractVector,α,β)
472472
c
473473
end
474474

475-
"""
475+
doc"""
476476
Compute Jacobi expansion coefficients in Pₙ^(α,β-1) given Jacobi expansion coefficients in Pₙ^(α,β) in-place.
477477
"""
478478
function decrementβ!(c::AbstractVector,α,β)
@@ -483,7 +483,7 @@ function decrementβ!(c::AbstractVector,α,β)
483483
c
484484
end
485485

486-
"""
486+
doc"""
487487
Compute Jacobi expansion coefficients in Pₙ^(α-1,α-1) given Jacobi expansion coefficients in Pₙ^(α,α) in-place.
488488
"""
489489
function decrementαβ!(c::AbstractVector,α,β)

src/toeplitzhankel.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""
1+
doc"""
22
Store a diagonally-scaled Toeplitz∘Hankel matrix:
33
44
DL(T∘H)DR

0 commit comments

Comments
 (0)