Skip to content

Commit 8d39317

Browse files
committed
Fix FFTW warning, tests pass in 0.7
1 parent b0d6e7c commit 8d39317

21 files changed

+131
-95
lines changed

REQUIRE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ 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

src/ChebyshevJacobiPlan.jl

Lines changed: 3 additions & 3 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

src/ChebyshevUltrasphericalPlan.jl

Lines changed: 3 additions & 3 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

src/FastTransforms.jl

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,17 @@ __precompile__()
22
module FastTransforms
33

44
using ToeplitzMatrices, HierarchicalMatrices, LowRankApprox, ProgressMeter, Compat,
5-
FFTW, AbstractFFTs
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
616

717
import Base: *, \, size, view
818
import Base: getindex, setindex!, Factorization, length
@@ -11,8 +21,6 @@ import HierarchicalMatrices: HierarchicalMatrix, unsafe_broadcasttimes!
1121
import HierarchicalMatrices: A_mul_B!, At_mul_B!, Ac_mul_B!
1222
import LowRankApprox: ColPerm
1323
import AbstractFFTs: Plan
14-
import FFTW: r2rFFTWPlan, unsafe_execute!, fftwSingle, fftwDouble, fftwNumber
15-
import FFTW: libfftw, libfftwf, PlanPtr, r2rFFTWPlan
1624

1725

1826
export cjt, icjt, jjt, plan_cjt, plan_icjt
@@ -50,7 +58,7 @@ include("fejer.jl")
5058
include("recurrence.jl")
5159
include("PaduaTransform.jl")
5260

53-
@compat abstract type FastTransformPlan{D,T} end
61+
abstract type FastTransformPlan{D,T} end
5462

5563
include("ChebyshevJacobiPlan.jl")
5664
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}

src/SphericalHarmonics/synthesisanalysis.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
immutable SynthesisPlan{T, P1, P2}
1+
struct SynthesisPlan{T, P1, P2}
22
planθ::P1
33
planφ::P2
44
C::ColumnPermutation
@@ -15,7 +15,7 @@ function plan_synthesis{T<:fftwNumber}(A::Matrix{T})
1515
SynthesisPlan(planθ, planφ, C, zeros(T, n))
1616
end
1717

18-
immutable AnalysisPlan{T, P1, P2}
18+
struct AnalysisPlan{T, P1, P2}
1919
planθ::P1
2020
planφ::P2
2121
C::ColumnPermutation

src/SphericalHarmonics/thinplan.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const LAYERSKELETON = 64
22

33
checklayer(j::Int) = j÷LAYERSKELETON == j/LAYERSKELETON
44

5-
immutable ThinSphericalHarmonicPlan{T} <: SphericalHarmonicPlan{T}
5+
struct ThinSphericalHarmonicPlan{T} <: SphericalHarmonicPlan{T}
66
RP::RotationPlan{T}
77
BF::Vector{Butterfly{T}}
88
p1::NormalizedLegendreToChebyshevPlan{T}

0 commit comments

Comments
 (0)