Skip to content

Commit a38d815

Browse files
add plan_*(::Type{Complex{T}}, x...)
in favour of plan_*(x::Array{Complex{T}}, y...) since this method is already covered by plan_*(x::Array{T}, y...) if T can also be complex Close #81
1 parent e279367 commit a38d815

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/libfasttransforms.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ for f in (:leg2cheb, :cheb2leg, :ultra2ultra, :jac2jac,
219219
plan_f = Symbol("plan_", f)
220220
@eval begin
221221
$plan_f(x::AbstractArray{T}, y...; z...) where T = $plan_f(T, size(x, 1), y...; z...)
222-
$plan_f(x::AbstractArray{Complex{T}}, y...; z...) where T <: Real = $plan_f(T, size(x, 1), y...; z...)
222+
$plan_f(::Type{Complex{T}}, y...; z...) where T <: Real = $plan_f(T, y...; z...)
223223
$f(x::AbstractArray, y...; z...) = $plan_f(x, y...; z...)*x
224224
end
225225
end
@@ -436,7 +436,7 @@ for (fJ, fC, fE, K) in ((:plan_sph_synthesis, :ft_plan_sph_synthesis, :ft_execut
436436
(:plan_tri_analysis, :ft_plan_tri_analysis, :ft_execute_tri_analysis, TRIANGLEANALYSIS))
437437
@eval begin
438438
$fJ(x::Matrix{T}) where T = $fJ(T, size(x, 1), size(x, 2))
439-
$fJ(x::Matrix{Complex{T}}) where T <: Real = $fJ(T, size(x, 1), size(x, 2))
439+
$fJ(::Type{Complex{T}}, x...) where T <: Real = $fJ(T, x...)
440440
function $fJ(::Type{Float64}, n::Integer, m::Integer)
441441
plan = ccall(($(string(fC)), libfasttransforms), Ptr{ft_plan_struct}, (Cint, Cint), n, m)
442442
return FTPlan{Float64, 2, $K}(plan, n, m)
@@ -452,7 +452,7 @@ for (fJ, fC, fE, K) in ((:plan_sph_synthesis, :ft_plan_sph_synthesis, :ft_execut
452452
end
453453

454454
plan_tet_synthesis(x::Array{T, 3}) where T = plan_tet_synthesis(T, size(x, 1), size(x, 2), size(x, 3))
455-
plan_tet_synthesis(x::Array{Complex{T}, 3}) where T <: Real = plan_tet_synthesis(T, size(x, 1), size(x, 2), size(x, 3))
455+
plan_tet_synthesis(::Type{Complex{T}}, x...) where T <: Real = plan_tet_synthesis(T, x...)
456456

457457
function plan_tet_synthesis(::Type{Float64}, n::Integer, l::Integer, m::Integer)
458458
plan = ccall((:ft_plan_tet_synthesis, libfasttransforms), Ptr{ft_plan_struct}, (Cint, Cint, Cint), n, l, m)
@@ -468,7 +468,7 @@ function lmul!(p::FTPlan{Float64, 3, TETRAHEDRONSYNTHESIS}, x::Array{Float64, 3}
468468
end
469469

470470
plan_tet_analysis(x::Array{T, 3}) where T = plan_tet_analysis(T, size(x, 1), size(x, 2), size(x, 3))
471-
plan_tet_analysis(x::Array{Complex{T}, 3}) where T <: Real = plan_tet_analysis(T, size(x, 1), size(x, 2), size(x, 3))
471+
plan_tet_analysis(::Type{Complex{T}}, x...) where T <: Real = plan_tet_analysis(T, x...)
472472

473473
function plan_tet_analysis(::Type{Float64}, n::Integer, l::Integer, m::Integer)
474474
plan = ccall((:ft_plan_tet_analysis, libfasttransforms), Ptr{ft_plan_struct}, (Cint, Cint, Cint), n, l, m)

0 commit comments

Comments
 (0)