Skip to content

Commit 24f040d

Browse files
Merge branch 'master' into feat-triangular-harmonics
2 parents 0c252e0 + bc60c12 commit 24f040d

35 files changed

+212
-192
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ os:
44
- linux
55
- osx
66
julia:
7-
- 0.5
87
- 0.6
98
- nightly
109
matrix:

REQUIRE

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
julia 0.5
1+
julia 0.6
22
ToeplitzMatrices 0.2
33
HierarchicalMatrices 0.0.2
44
LowRankApprox 0.0.2
55
ProgressMeter 0.3.4
6+
SpecialFunctions 0.3.4
67
Compat 0.17

appveyor.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
environment:
22
matrix:
3-
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x86/0.5/julia-0.5-latest-win32.exe"
4-
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x64/0.5/julia-0.5-latest-win64.exe"
53
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x86/0.6/julia-0.6-latest-win32.exe"
64
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x64/0.6/julia-0.6-latest-win64.exe"
75
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x86/julia-latest-win32.exe"

src/ChebyshevJacobiPlan.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
immutable ChebyshevJacobiConstants{D,T}
1+
struct ChebyshevJacobiConstants{D,T}
22
α::T
33
β::T
44
M::Int
@@ -23,7 +23,7 @@ function ChebyshevJacobiConstants{T}(c::AbstractVector{T},α::T,β::T;M::Int=7,D
2323
ChebyshevJacobiConstants{D,T}(α,β,M,N,nM₀,αN,K)
2424
end
2525

26-
immutable ChebyshevJacobiIndices
26+
struct ChebyshevJacobiIndices
2727
i₁::Vector{Int}
2828
i₂::Vector{Int}
2929
j₁::Vector{Int}
@@ -53,7 +53,7 @@ function ChebyshevJacobiIndices{D,T}(α::T,β::T,CJC::ChebyshevJacobiConstants{D
5353
ChebyshevJacobiIndices(i₁,i₂,j₁,j₂)
5454
end
5555

56-
type ChebyshevJacobiPlan{D,T,DCT,DST,SA} <: FastTransformPlan{D,T}
56+
mutable struct ChebyshevJacobiPlan{D,T,DCT,DST,SA} <: FastTransformPlan{D,T}
5757
CJC::ChebyshevJacobiConstants{D,T}
5858
CJI::ChebyshevJacobiIndices
5959
p₁::DCT
@@ -142,7 +142,7 @@ function ForwardChebyshevJacobiPlan{T}(c_jac::AbstractVector{T},α::T,β::T,M::I
142142
@inbounds for i=1:N+1 tempcosβsinα[i] = tempcos[i]^+1/2)*tempsin[i]^+1/2) end
143143

144144
# Initialize normalizing constant
145-
cnαβ = Cnαβ(0:N,α,β)
145+
cnαβ = Cnαβ.(0:N,α,β)
146146
cnmαβ = zero(cnαβ)
147147

148148
# Get indices
@@ -184,11 +184,11 @@ function BackwardChebyshevJacobiPlan{T}(c_cheb::AbstractVector{T},α::T,β::T,M:
184184
@inbounds for i=1:2N+1 tempcosβsinα[i] = tempcos[i]^+1/2)*tempsin[i]^+1/2) end
185185

186186
# Initialize normalizing constant
187-
cnαβ = Cnαβ(0:2N,α,β)
187+
cnαβ = Cnαβ.(0:2N,α,β)
188188
cnmαβ = zero(cnαβ)
189189

190190
# Initialize orthonormality constants
191-
anαβ = Anαβ(0:N,α,β)
191+
anαβ = Anαβ.(0:N,α,β)
192192

193193
# Get indices
194194
CJI = ChebyshevJacobiIndices(α,β,CJC,tempmindices,cfs,tempcos,tempsin,tempcosβsinα)

src/ChebyshevUltrasphericalPlan.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
immutable ChebyshevUltrasphericalConstants{D,T}
1+
struct ChebyshevUltrasphericalConstants{D,T}
22
λ::T
33
M::Int
44
N::Int
@@ -23,7 +23,7 @@ function ChebyshevUltrasphericalConstants{T}(c::AbstractVector{T},λ::T;M::Int=7
2323
ChebyshevUltrasphericalConstants{D,T}(λ,M,N,nM₀,αN,K)
2424
end
2525

26-
immutable ChebyshevUltrasphericalIndices
26+
struct ChebyshevUltrasphericalIndices
2727
i₁::Vector{Int}
2828
i₂::Vector{Int}
2929
j₁::Vector{Int}
@@ -53,7 +53,7 @@ function ChebyshevUltrasphericalIndices{D,T}(λ::T,CUC::ChebyshevUltrasphericalC
5353
ChebyshevUltrasphericalIndices(i₁,i₂,j₁,j₂)
5454
end
5555

56-
type ChebyshevUltrasphericalPlan{D,T,DCT,DST,SA} <: FastTransformPlan{D,T}
56+
mutable struct ChebyshevUltrasphericalPlan{D,T,DCT,DST,SA} <: FastTransformPlan{D,T}
5757
CUC::ChebyshevUltrasphericalConstants{D,T}
5858
CUI::ChebyshevUltrasphericalIndices
5959
p₁::DCT
@@ -184,7 +184,7 @@ function BackwardChebyshevUltrasphericalPlan{T}(c_ultra::AbstractVector{T},λ::T
184184
cnmλ = similar(cnλ)
185185

186186
# Initialize orthonormality constants
187-
anλ = Anαβ(0:N,λ-half(λ),λ-half(λ))
187+
anλ = Anαβ.(0:N,λ-half(λ),λ-half(λ))
188188

189189
# Get indices
190190
CUI = ChebyshevUltrasphericalIndices(λ,CUC,tempmindices,tempsin,tempsinλ)

src/FastTransforms.jl

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,27 @@
11
__precompile__()
22
module FastTransforms
33

4-
using Base, ToeplitzMatrices, HierarchicalMatrices, LowRankApprox, ProgressMeter, Compat
4+
using ToeplitzMatrices, HierarchicalMatrices, LowRankApprox, ProgressMeter, Compat,
5+
AbstractFFTs, SpecialFunctions
6+
7+
if VERSION < v"0.7-"
8+
using Base.FFTW
9+
import Base.FFTW: r2rFFTWPlan, unsafe_execute!, fftwSingle, fftwDouble, fftwNumber
10+
import Base.FFTW: libfftw, libfftwf, PlanPtr, r2rFFTWPlan
11+
else
12+
using FFTW
13+
import FFTW: r2rFFTWPlan, unsafe_execute!, fftwSingle, fftwDouble, fftwNumber
14+
import FFTW: libfftw, libfftwf, PlanPtr, r2rFFTWPlan
15+
end
516

617
import Base: *, \, size, view
718
import Base: getindex, setindex!, Factorization, length
819
import Base.LinAlg: BlasFloat, BlasInt
920
import HierarchicalMatrices: HierarchicalMatrix, unsafe_broadcasttimes!
1021
import HierarchicalMatrices: A_mul_B!, At_mul_B!, Ac_mul_B!
1122
import LowRankApprox: ColPerm
23+
import AbstractFFTs: Plan
24+
1225

1326
export cjt, icjt, jjt, plan_cjt, plan_icjt
1427
export leg2cheb, cheb2leg, leg2chebu, ultra2ultra, jac2jac
@@ -49,7 +62,7 @@ include("fejer.jl")
4962
include("recurrence.jl")
5063
include("PaduaTransform.jl")
5164

52-
@compat abstract type FastTransformPlan{D,T} end
65+
abstract type FastTransformPlan{D,T} end
5366

5467
include("ChebyshevJacobiPlan.jl")
5568
include("jac2cheb.jl")

src/PaduaTransform.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ doc"""
22
Pre-plan an Inverse Padua Transform.
33
"""
44
# lex indicates if its lexigraphical (i.e., x, y) or reverse (y, x)
5-
immutable IPaduaTransformPlan{lex,IDCTPLAN,T}
5+
struct IPaduaTransformPlan{lex,IDCTPLAN,T}
66
cfsmat::Matrix{T}
77
idctplan::IDCTPLAN
88
end
@@ -103,7 +103,7 @@ end
103103
doc"""
104104
Pre-plan a Padua Transform.
105105
"""
106-
immutable PaduaTransformPlan{lex,DCTPLAN,T}
106+
struct PaduaTransformPlan{lex,DCTPLAN,T}
107107
vals::Matrix{T}
108108
dctplan::DCTPLAN
109109
end

src/SphericalHarmonics/Butterfly.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
immutable Butterfly{T} <: Factorization{T}
1+
struct Butterfly{T} <: Factorization{T}
22
columns::Vector{Matrix{T}}
33
factors::Vector{Vector{IDPackedV{T}}}
44
permutations::Vector{Vector{ColumnPermutation}}
@@ -60,7 +60,7 @@ function Butterfly{T}(A::AbstractMatrix{T}, L::Int; isorthogonal::Bool = false,
6060
end
6161
permutations[1][j] = factors[1][j][:P]
6262
indices[1][j+1] = indices[1][j] + size(factors[1][j], 1)
63-
cs[1][j] = factors[1][j].sk+nl-1
63+
cs[1][j] = factors[1][j].sk .+ nl .- 1
6464
end
6565

6666
ii, jj = 2, (tL>>1)
@@ -276,7 +276,7 @@ function A_mul_B_col_J!{T}(u::VecOrMat{T}, B::Butterfly{T}, b::VecOrMat{T}, J::I
276276
end
277277

278278
for f! in (:At_mul_B!,:Ac_mul_B!)
279-
f_col_J! = parse(string(f!)[1:end-1]*"_col_J!")
279+
f_col_J! = Meta.parse(string(f!)[1:end-1]*"_col_J!")
280280
@eval begin
281281
function $f_col_J!{T}(u::VecOrMat{T}, B::Butterfly{T}, b::VecOrMat{T}, J::Int)
282282
L = length(B.factors) - 1

src/SphericalHarmonics/fastplan.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
immutable FastSphericalHarmonicPlan{T} <: SphericalHarmonicPlan{T}
1+
struct FastSphericalHarmonicPlan{T} <: SphericalHarmonicPlan{T}
22
RP::RotationPlan{T}
33
BF::Vector{Butterfly{T}}
44
p1::NormalizedLegendreToChebyshevPlan{T}

src/SphericalHarmonics/slowplan.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function A_mul_B!{T<:Real}(A::AbstractMatrix, G::Givens{T})
4141
return A
4242
end
4343

44-
immutable Pnmp2toPlm{T} <: AbstractRotation{T}
44+
struct Pnmp2toPlm{T} <: AbstractRotation{T}
4545
rotations::Vector{Givens{T}}
4646
end
4747

@@ -73,7 +73,7 @@ function Base.A_mul_B!(A::AbstractMatrix, C::Pnmp2toPlm)
7373
end
7474

7575

76-
immutable RotationPlan{T} <: AbstractRotation{T}
76+
struct RotationPlan{T} <: AbstractRotation{T}
7777
layers::Vector{Pnmp2toPlm{T}}
7878
end
7979

@@ -126,7 +126,7 @@ end
126126
Base.Ac_mul_B!(P::RotationPlan, A::AbstractMatrix) = At_mul_B!(P, A)
127127

128128

129-
immutable SlowSphericalHarmonicPlan{T} <: SphericalHarmonicPlan{T}
129+
struct SlowSphericalHarmonicPlan{T} <: SphericalHarmonicPlan{T}
130130
RP::RotationPlan{T}
131131
p1::NormalizedLegendreToChebyshevPlan{T}
132132
p2::NormalizedLegendre1ToChebyshev2Plan{T}

0 commit comments

Comments
 (0)