Skip to content

Commit 17be0ef

Browse files
polish off the rest of the adjoints and transposes
1 parent 4a7e2c8 commit 17be0ef

File tree

2 files changed

+146
-106
lines changed

2 files changed

+146
-106
lines changed

src/libfasttransforms.jl

Lines changed: 139 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -217,12 +217,20 @@ show(io::IO, p::FTPlan{T, 2, K}) where {T, K} = print(io, "FastTransforms plan f
217217
show(io::IO, p::FTPlan{T, 3, K}) where {T, K} = print(io, "FastTransforms plan for ", kind2string(K), " for $(p.n)×$(p.l)×$(p.m)-element array of ", T)
218218
show(io::IO, p::FTPlan{T, 2, SPHERICALISOMETRY}) where T = print(io, "FastTransforms ", kind2string(SPHERICALISOMETRY), " plan for $(p.n)×$(2p.n-1)-element array of ", T)
219219

220-
function checksize(p::FTPlan{T}, x::Array{T}) where T
220+
function checksize(p::FTPlan{T, 1}, x::Array{T}) where T
221221
if p.n != size(x, 1)
222222
throw(DimensionMismatch("FTPlan has dimensions $(p.n) × $(p.n), x has leading dimension $(size(x, 1))"))
223223
end
224224
end
225225

226+
for (N, K) in ((2, RECTDISK), (2, TRIANGLE), (3, TETRAHEDRON))
227+
@eval function checksize(p::FTPlan{T, $N, $K}, x::Array{T, $N}) where T
228+
if p.n != size(x, 1)
229+
throw(DimensionMismatch("FTPlan has dimensions $(p.n) × $(p.n), x has leading dimension $(size(x, 1))"))
230+
end
231+
end
232+
end
233+
226234
for K in (SPHERE, SPHEREV, DISK, SPINSPHERE)
227235
@eval function checksize(p::FTPlan{T, 2, $K}, x::Matrix{T}) where T
228236
if p.n != size(x, 1)
@@ -234,6 +242,18 @@ for K in (SPHERE, SPHEREV, DISK, SPINSPHERE)
234242
end
235243
end
236244

245+
function checksize(p::FTPlan{T, 2}, x::Array{T, 2}) where T
246+
if p.n != size(x, 1) || p.m != size(x, 2)
247+
throw(DimensionMismatch("FTPlan has dimensions $(p.n) × $(p.m), x has dimensions $(size(x, 1)) × $(size(x, 2))"))
248+
end
249+
end
250+
251+
function checksize(p::FTPlan{T, 3}, x::Array{T, 3}) where T
252+
if p.n != size(x, 1) || p.l != size(x, 2) || p.m != size(x, 3)
253+
throw(DimensionMismatch("FTPlan has dimensions $(p.n) × $(p.l) × $(p.m), x has dimensions $(size(x, 1)) × $(size(x, 2)) × $(size(x, 3))"))
254+
end
255+
end
256+
237257
function checksize(p::FTPlan{T, 2, SPHERICALISOMETRY}, x::Matrix{T}) where T
238258
if p.n != size(x, 1) || 2p.n-1 != size(x, 2)
239259
throw(DimensionMismatch("This FTPlan must operate on arrays of size $(p.n) × $(2p.n-1)."))
@@ -290,10 +310,29 @@ function show(io::IO, p::AdjointFTPlan)
290310
show(io, p.parent)
291311
end
292312

293-
checksize(p::AdjointFTPlan, x) = checksize(p.parent, x)
313+
function checksize(p::AdjointFTPlan, x)
314+
try
315+
checksize(p.adjoint, x)
316+
catch
317+
checksize(p.parent, x)
318+
end
319+
end
294320

295-
unsafe_convert(::Type{Ptr{ft_plan_struct}}, p::AdjointFTPlan) = unsafe_convert(Ptr{ft_plan_struct}, p.parent)
296-
unsafe_convert(::Type{Ptr{mpfr_t}}, p::AdjointFTPlan) = unsafe_convert(Ptr{mpfr_t}, p.parent)
321+
function unsafe_convert(::Type{Ptr{ft_plan_struct}}, p::AdjointFTPlan)
322+
try
323+
unsafe_convert(Ptr{ft_plan_struct}, p.adjoint)
324+
catch
325+
unsafe_convert(Ptr{ft_plan_struct}, p.parent)
326+
end
327+
end
328+
329+
function unsafe_convert(::Type{Ptr{mpfr_t}}, p::AdjointFTPlan)
330+
try
331+
unsafe_convert(Ptr{mpfr_t}, p.adjoint)
332+
catch
333+
unsafe_convert(Ptr{mpfr_t}, p.parent)
334+
end
335+
end
297336

298337
struct TransposeFTPlan{T, S, R}
299338
parent::S
@@ -319,10 +358,29 @@ function show(io::IO, p::TransposeFTPlan)
319358
show(io, p.parent)
320359
end
321360

322-
checksize(p::TransposeFTPlan, x) = checksize(p.parent, x)
361+
function checksize(p::TransposeFTPlan, x)
362+
try
363+
checksize(p.transpose, x)
364+
catch
365+
checksize(p.parent, x)
366+
end
367+
end
323368

324-
unsafe_convert(::Type{Ptr{ft_plan_struct}}, p::TransposeFTPlan) = unsafe_convert(Ptr{ft_plan_struct}, p.parent)
325-
unsafe_convert(::Type{Ptr{mpfr_t}}, p::TransposeFTPlan) = unsafe_convert(Ptr{mpfr_t}, p.parent)
369+
function unsafe_convert(::Type{Ptr{ft_plan_struct}}, p::TransposeFTPlan)
370+
try
371+
unsafe_convert(Ptr{ft_plan_struct}, p.transpose)
372+
catch
373+
unsafe_convert(Ptr{ft_plan_struct}, p.parent)
374+
end
375+
end
376+
377+
function unsafe_convert(::Type{Ptr{mpfr_t}}, p::TransposeFTPlan)
378+
try
379+
unsafe_convert(Ptr{mpfr_t}, p.transpose)
380+
catch
381+
unsafe_convert(Ptr{mpfr_t}, p.parent)
382+
end
383+
end
326384

327385
for f in (:leg2cheb, :cheb2leg, :ultra2ultra, :jac2jac,
328386
:lag2lag, :jac2ultra, :ultra2jac, :jac2cheb,
@@ -563,9 +621,15 @@ function plan_spinsph2fourier(::Type{Complex{Float64}}, n::Integer, s::Integer)
563621
end
564622

565623
for (fJ, fadJ, fC, fE, K) in ((:plan_sph_synthesis, :plan_sph_analysis, :ft_plan_sph_synthesis, :ft_execute_sph_synthesis, SPHERESYNTHESIS),
566-
(:plan_sph_analysis, :plan_sph_synthesis, :ft_plan_sph_analysis, :ft_execute_sph_analysis, SPHEREANALYSIS),
567-
(:plan_sphv_synthesis, :plan_sphv_analysis, :ft_plan_sphv_synthesis, :ft_execute_sphv_synthesis, SPHEREVSYNTHESIS),
568-
(:plan_sphv_analysis, :plan_sphv_synthesis, :ft_plan_sphv_analysis, :ft_execute_sphv_analysis, SPHEREVANALYSIS))
624+
(:plan_sph_analysis, :plan_sph_synthesis, :ft_plan_sph_analysis, :ft_execute_sph_analysis, SPHEREANALYSIS),
625+
(:plan_sphv_synthesis, :plan_sphv_analysis, :ft_plan_sphv_synthesis, :ft_execute_sphv_synthesis, SPHEREVSYNTHESIS),
626+
(:plan_sphv_analysis, :plan_sphv_synthesis, :ft_plan_sphv_analysis, :ft_execute_sphv_analysis, SPHEREVANALYSIS),
627+
(:plan_disk_synthesis, :plan_disk_analysis, :ft_plan_disk_synthesis, :ft_execute_disk_synthesis, DISKSYNTHESIS),
628+
(:plan_disk_analysis, :plan_disk_synthesis, :ft_plan_disk_analysis, :ft_execute_disk_analysis, DISKANALYSIS),
629+
(:plan_rectdisk_synthesis, :plan_rectdisk_analysis, :ft_plan_rectdisk_synthesis, :ft_execute_rectdisk_synthesis, RECTDISKSYNTHESIS),
630+
(:plan_rectdisk_analysis, :plan_rectdisk_synthesis, :ft_plan_rectdisk_analysis, :ft_execute_rectdisk_analysis, RECTDISKANALYSIS),
631+
(:plan_tri_synthesis, :plan_tri_analysis, :ft_plan_tri_synthesis, :ft_execute_tri_synthesis, TRIANGLESYNTHESIS),
632+
(:plan_tri_analysis, :plan_tri_synthesis, :ft_plan_tri_analysis, :ft_execute_tri_analysis, TRIANGLEANALYSIS))
569633
@eval begin
570634
$fJ(x::Matrix{T}) where T = $fJ(T, size(x, 1), size(x, 2))
571635
$fJ(::Type{Complex{T}}, x...) where T <: Real = $fJ(T, x...)
@@ -576,112 +640,81 @@ for (fJ, fadJ, fC, fE, K) in ((:plan_sph_synthesis, :plan_sph_analysis, :ft_plan
576640
adjoint(p::FTPlan{T, 2, $K}) where T = AdjointFTPlan(p, $fadJ(T, p.n, p.m))
577641
transpose(p::FTPlan{T, 2, $K}) where T = TransposeFTPlan(p, $fadJ(T, p.n, p.m))
578642
function lmul!(p::FTPlan{Float64, 2, $K}, x::Matrix{Float64})
579-
if p.n != size(x, 1) || p.m != size(x, 2)
580-
throw(DimensionMismatch("FTPlan has dimensions $(p.n) × $(p.m), x has dimensions $(size(x, 1)) × $(size(x, 2))"))
581-
end
643+
checksize(p, x)
582644
ccall(($(string(fE)), libfasttransforms), Cvoid, (Cint, Ptr{ft_plan_struct}, Ptr{Float64}, Cint, Cint), 'N', p, x, size(x, 1), size(x, 2))
583645
return x
584646
end
585647
function lmul!(p::AdjointFTPlan{Float64, FTPlan{Float64, 2, $K}}, x::Matrix{Float64})
586-
if p.adjoint.n != size(x, 1) || p.adjoint.m != size(x, 2)
587-
throw(DimensionMismatch("FTPlan has dimensions $(p.n) × $(p.m), x has dimensions $(size(x, 1)) × $(size(x, 2))"))
588-
end
589-
ccall(($(string(fE)), libfasttransforms), Cvoid, (Cint, Ptr{ft_plan_struct}, Ptr{Float64}, Cint, Cint), 'T', p.adjoint, x, size(x, 1), size(x, 2))
648+
checksize(p, x)
649+
ccall(($(string(fE)), libfasttransforms), Cvoid, (Cint, Ptr{ft_plan_struct}, Ptr{Float64}, Cint, Cint), 'T', p, x, size(x, 1), size(x, 2))
590650
return x
591651
end
592652
function lmul!(p::TransposeFTPlan{Float64, FTPlan{Float64, 2, $K}}, x::Matrix{Float64})
593-
if p.transpose.n != size(x, 1) || p.transpose.m != size(x, 2)
594-
throw(DimensionMismatch("FTPlan has dimensions $(p.n) × $(p.m), x has dimensions $(size(x, 1)) × $(size(x, 2))"))
595-
end
596-
ccall(($(string(fE)), libfasttransforms), Cvoid, (Cint, Ptr{ft_plan_struct}, Ptr{Float64}, Cint, Cint), 'T', p.transpose, x, size(x, 1), size(x, 2))
653+
checksize(p, x)
654+
ccall(($(string(fE)), libfasttransforms), Cvoid, (Cint, Ptr{ft_plan_struct}, Ptr{Float64}, Cint, Cint), 'T', p, x, size(x, 1), size(x, 2))
597655
return x
598656
end
599657
end
600658
end
601659

602-
for (fJ, fC, fE, K) in ((:plan_disk_synthesis, :ft_plan_disk_synthesis, :ft_execute_disk_synthesis, DISKSYNTHESIS),
603-
(:plan_disk_analysis, :ft_plan_disk_analysis, :ft_execute_disk_analysis, DISKANALYSIS),
604-
(:plan_rectdisk_synthesis, :ft_plan_rectdisk_synthesis, :ft_execute_rectdisk_synthesis, RECTDISKSYNTHESIS),
605-
(:plan_rectdisk_analysis, :ft_plan_rectdisk_analysis, :ft_execute_rectdisk_analysis, RECTDISKANALYSIS),
606-
(:plan_tri_synthesis, :ft_plan_tri_synthesis, :ft_execute_tri_synthesis, TRIANGLESYNTHESIS),
607-
(:plan_tri_analysis, :ft_plan_tri_analysis, :ft_execute_tri_analysis, TRIANGLEANALYSIS))
660+
for (fJ, fadJ, fC, fE, K) in ((:plan_tet_synthesis, :plan_tet_analysis, :ft_plan_tet_synthesis, :ft_execute_tet_synthesis, TETRAHEDRONSYNTHESIS),
661+
(:plan_tet_analysis, :plan_tet_synthesis, :ft_plan_tet_analysis, :ft_execute_tet_analysis, TETRAHEDRONANALYSIS))
608662
@eval begin
609-
$fJ(x::Matrix{T}) where T = $fJ(T, size(x, 1), size(x, 2))
663+
$fJ(x::Array{T, 3}) where T = $fJ(T, size(x, 1), size(x, 2), size(x, 3))
610664
$fJ(::Type{Complex{T}}, x...) where T <: Real = $fJ(T, x...)
611-
function $fJ(::Type{Float64}, n::Integer, m::Integer)
612-
plan = ccall(($(string(fC)), libfasttransforms), Ptr{ft_plan_struct}, (Cint, Cint), n, m)
613-
return FTPlan{Float64, 2, $K}(plan, n, m)
665+
function $fJ(::Type{Float64}, n::Integer, l::Integer, m::Integer)
666+
plan = ccall(($(string(fC)), libfasttransforms), Ptr{ft_plan_struct}, (Cint, Cint, Cint), n, l, m)
667+
return FTPlan{Float64, 3, $K}(plan, n, l, m)
614668
end
615-
function lmul!(p::FTPlan{Float64, 2, $K}, x::Matrix{Float64})
616-
if p.n != size(x, 1) || p.m != size(x, 2)
617-
throw(DimensionMismatch("FTPlan has dimensions $(p.n) × $(p.m), x has dimensions $(size(x, 1)) × $(size(x, 2))"))
618-
end
619-
ccall(($(string(fE)), libfasttransforms), Cvoid, (Ptr{ft_plan_struct}, Ptr{Float64}, Cint, Cint), p, x, size(x, 1), size(x, 2))
669+
adjoint(p::FTPlan{T, 3, $K}) where T = AdjointFTPlan(p, $fadJ(T, p.n, p.l, p.m))
670+
transpose(p::FTPlan{T, 3, $K}) where T = TransposeFTPlan(p, $fadJ(T, p.n, p.l, p.m))
671+
function lmul!(p::FTPlan{Float64, 3, $K}, x::Array{Float64, 3})
672+
checksize(p, x)
673+
ccall(($(string(fE)), libfasttransforms), Cvoid, (Cint, Ptr{ft_plan_struct}, Ptr{Float64}, Cint, Cint, Cint), 'N', p, x, size(x, 1), size(x, 2), size(x, 3))
674+
return x
675+
end
676+
function lmul!(p::AdjointFTPlan{Float64, FTPlan{Float64, 3, $K}}, x::Array{Float64, 3})
677+
checksize(p, x)
678+
ccall(($(string(fE)), libfasttransforms), Cvoid, (Cint, Ptr{ft_plan_struct}, Ptr{Float64}, Cint, Cint, Cint), 'T', p, x, size(x, 1), size(x, 2), size(x, 3))
679+
return x
680+
end
681+
function lmul!(p::TransposeFTPlan{Float64, FTPlan{Float64, 3, $K}}, x::Array{Float64, 3})
682+
checksize(p, x)
683+
ccall(($(string(fE)), libfasttransforms), Cvoid, (Cint, Ptr{ft_plan_struct}, Ptr{Float64}, Cint, Cint, Cint), 'T', p, x, size(x, 1), size(x, 2), size(x, 3))
620684
return x
621685
end
622686
end
623687
end
624688

625-
plan_tet_synthesis(x::Array{T, 3}) where T = plan_tet_synthesis(T, size(x, 1), size(x, 2), size(x, 3))
626-
plan_tet_synthesis(::Type{Complex{T}}, x...) where T <: Real = plan_tet_synthesis(T, x...)
627-
628-
function plan_tet_synthesis(::Type{Float64}, n::Integer, l::Integer, m::Integer)
629-
plan = ccall((:ft_plan_tet_synthesis, libfasttransforms), Ptr{ft_plan_struct}, (Cint, Cint, Cint), n, l, m)
630-
return FTPlan{Float64, 3, TETRAHEDRONSYNTHESIS}(plan, n, l, m)
631-
end
632-
633-
function lmul!(p::FTPlan{Float64, 3, TETRAHEDRONSYNTHESIS}, x::Array{Float64, 3})
634-
if p.n != size(x, 1) || p.l != size(x, 2) || p.m != size(x, 3)
635-
throw(DimensionMismatch("FTPlan has dimensions $(p.n) × $(p.l) × $(p.m), x has dimensions $(size(x, 1)) × $(size(x, 2)) × $(size(x, 3))"))
636-
end
637-
ccall((:ft_execute_tet_synthesis, libfasttransforms), Cvoid, (Ptr{ft_plan_struct}, Ptr{Float64}, Cint, Cint, Cint), p, x, size(x, 1), size(x, 2), size(x, 3))
638-
return x
639-
end
640-
641-
plan_tet_analysis(x::Array{T, 3}) where T = plan_tet_analysis(T, size(x, 1), size(x, 2), size(x, 3))
642-
plan_tet_analysis(::Type{Complex{T}}, x...) where T <: Real = plan_tet_analysis(T, x...)
643-
644-
function plan_tet_analysis(::Type{Float64}, n::Integer, l::Integer, m::Integer)
645-
plan = ccall((:ft_plan_tet_analysis, libfasttransforms), Ptr{ft_plan_struct}, (Cint, Cint, Cint), n, l, m)
646-
return FTPlan{Float64, 3, TETRAHEDRONANALYSIS}(plan, n, l, m)
647-
end
648-
649-
function lmul!(p::FTPlan{Float64, 3, TETRAHEDRONANALYSIS}, x::Array{Float64, 3})
650-
if p.n != size(x, 1) || p.l != size(x, 2) || p.m != size(x, 3)
651-
throw(DimensionMismatch("FTPlan has dimensions $(p.n) × $(p.l) × $(p.m), x has dimensions $(size(x, 1)) × $(size(x, 2)) × $(size(x, 3))"))
652-
end
653-
ccall((:ft_execute_tet_analysis, libfasttransforms), Cvoid, (Ptr{ft_plan_struct}, Ptr{Float64}, Cint, Cint, Cint), p, x, size(x, 1), size(x, 2), size(x, 3))
654-
return x
655-
end
656-
657-
plan_spinsph_synthesis(x::Matrix{T}, s::Integer) where T = plan_spinsph_synthesis(T, size(x, 1), size(x, 2), s)
658-
659-
function plan_spinsph_synthesis(::Type{Complex{Float64}}, n::Integer, m::Integer, s::Integer)
660-
plan = ccall((:ft_plan_spinsph_synthesis, libfasttransforms), Ptr{ft_plan_struct}, (Cint, Cint, Cint), n, m, s)
661-
return FTPlan{Complex{Float64}, 2, SPINSPHERESYNTHESIS}(plan, n, m)
662-
end
663-
664-
function lmul!(p::FTPlan{Complex{Float64}, 2, SPINSPHERESYNTHESIS}, x::Matrix{Complex{Float64}})
665-
if p.n != size(x, 1) || p.m != size(x, 2)
666-
throw(DimensionMismatch("FTPlan has dimensions $(p.n) × $(p.m), x has dimensions $(size(x, 1)) × $(size(x, 2))"))
667-
end
668-
ccall((:ft_execute_spinsph_synthesis, libfasttransforms), Cvoid, (Ptr{ft_plan_struct}, Ptr{Float64}, Cint, Cint), p, x, size(x, 1), size(x, 2))
669-
return x
670-
end
671-
672-
plan_spinsph_analysis(x::Matrix{T}, s::Integer) where T = plan_spinsph_analysis(T, size(x, 1), size(x, 2), s)
673-
674-
function plan_spinsph_analysis(::Type{Complex{Float64}}, n::Integer, m::Integer, s::Integer)
675-
plan = ccall((:ft_plan_spinsph_analysis, libfasttransforms), Ptr{ft_plan_struct}, (Cint, Cint, Cint), n, m, s)
676-
return FTPlan{Complex{Float64}, 2, SPINSPHEREANALYSIS}(plan, n, m)
677-
end
678-
679-
function lmul!(p::FTPlan{Complex{Float64}, 2, SPINSPHEREANALYSIS}, x::Matrix{Complex{Float64}})
680-
if p.n != size(x, 1) || p.m != size(x, 2)
681-
throw(DimensionMismatch("FTPlan has dimensions $(p.n) × $(p.m), x has dimensions $(size(x, 1)) × $(size(x, 2))"))
689+
for (fJ, fadJ, fC, fE, K) in ((:plan_spinsph_synthesis, :plan_spinsph_analysis, :ft_plan_spinsph_synthesis, :ft_execute_spinsph_synthesis, SPINSPHERESYNTHESIS),
690+
(:plan_spinsph_analysis, :plan_spinsph_synthesis, :ft_plan_spinsph_analysis, :ft_execute_spinsph_analysis, SPINSPHEREANALYSIS))
691+
@eval begin
692+
$fJ(x::Matrix{T}, s::Integer) where T = $fJ(T, size(x, 1), size(x, 2), s)
693+
function $fJ(::Type{Complex{Float64}}, n::Integer, m::Integer, s::Integer)
694+
plan = ccall(($(string(fC)), libfasttransforms), Ptr{ft_plan_struct}, (Cint, Cint, Cint), n, m, s)
695+
return FTPlan{Complex{Float64}, 2, $K}(plan, n, m)
696+
end
697+
get_spin(p::FTPlan{T, 2, $K}) where T = ccall((:ft_get_spin_spinsphere_fftw_plan, libfasttransforms), Cint, (Ptr{ft_plan_struct},), p)
698+
adjoint(p::FTPlan{T, 2, $K}) where T = AdjointFTPlan(p, $fadJ(T, p.n, p.m, get_spin(p)))
699+
transpose(p::FTPlan{T, 2, $K}) where T = TransposeFTPlan(p, $fadJ(T, p.n, p.m, get_spin(p)))
700+
function lmul!(p::FTPlan{Complex{Float64}, 2, $K}, x::Matrix{Complex{Float64}})
701+
checksize(p, x)
702+
ccall(($(string(fE)), libfasttransforms), Cvoid, (Cint, Ptr{ft_plan_struct}, Ptr{Float64}, Cint, Cint), 'N', p, x, size(x, 1), size(x, 2))
703+
return x
704+
end
705+
function lmul!(p::AdjointFTPlan{Complex{Float64}, FTPlan{Complex{Float64}, 2, $K}}, x::Matrix{Complex{Float64}})
706+
checksize(p, x)
707+
ccall(($(string(fE)), libfasttransforms), Cvoid, (Cint, Ptr{ft_plan_struct}, Ptr{Float64}, Cint, Cint), 'C', p, x, size(x, 1), size(x, 2))
708+
return x
709+
end
710+
function lmul!(p::TransposeFTPlan{Complex{Float64}, FTPlan{Complex{Float64}, 2, $K}}, x::Matrix{Complex{Float64}})
711+
checksize(p, x)
712+
conj!(x)
713+
ccall(($(string(fE)), libfasttransforms), Cvoid, (Cint, Ptr{ft_plan_struct}, Ptr{Float64}, Cint, Cint), 'C', p, x, size(x, 1), size(x, 2))
714+
conj!(x)
715+
return x
716+
end
682717
end
683-
ccall((:ft_execute_spinsph_analysis, libfasttransforms), Cvoid, (Ptr{ft_plan_struct}, Ptr{Float64}, Cint, Cint), p, x, size(x, 1), size(x, 2))
684-
return x
685718
end
686719

687720
function plan_sph_isometry(::Type{Float64}, n::Integer)
@@ -834,17 +867,17 @@ for (fJ, fC) in ((:lmul!, :ft_mpfr_trmm_ptr),
834867
end
835868

836869
for (fJ, fC, T, N, K) in ((:lmul!, :ft_execute_sph2fourier, Float64, 2, SPHERE),
837-
(:ldiv!, :ft_execute_fourier2sph, Float64, 2, SPHERE),
838-
(:lmul!, :ft_execute_sphv2fourier, Float64, 2, SPHEREV),
839-
(:ldiv!, :ft_execute_fourier2sphv, Float64, 2, SPHEREV),
840-
(:lmul!, :ft_execute_spinsph2fourier, Complex{Float64}, 2, SPINSPHERE),
841-
(:ldiv!, :ft_execute_fourier2spinsph, Complex{Float64}, 2, SPINSPHERE),
842-
(:lmul!, :ft_execute_disk2cxf, Float64, 2, DISK),
843-
(:ldiv!, :ft_execute_cxf2disk, Float64, 2, DISK),
844-
(:lmul!, :ft_execute_rectdisk2cheb, Float64, 2, RECTDISK),
845-
(:ldiv!, :ft_execute_cheb2rectdisk, Float64, 2, RECTDISK),
846-
(:lmul!, :ft_execute_tri2cheb, Float64, 2, TRIANGLE),
847-
(:ldiv!, :ft_execute_cheb2tri, Float64, 2, TRIANGLE))
870+
(:ldiv!, :ft_execute_fourier2sph, Float64, 2, SPHERE),
871+
(:lmul!, :ft_execute_sphv2fourier, Float64, 2, SPHEREV),
872+
(:ldiv!, :ft_execute_fourier2sphv, Float64, 2, SPHEREV),
873+
(:lmul!, :ft_execute_spinsph2fourier, Complex{Float64}, 2, SPINSPHERE),
874+
(:ldiv!, :ft_execute_fourier2spinsph, Complex{Float64}, 2, SPINSPHERE),
875+
(:lmul!, :ft_execute_disk2cxf, Float64, 2, DISK),
876+
(:ldiv!, :ft_execute_cxf2disk, Float64, 2, DISK),
877+
(:lmul!, :ft_execute_rectdisk2cheb, Float64, 2, RECTDISK),
878+
(:ldiv!, :ft_execute_cheb2rectdisk, Float64, 2, RECTDISK),
879+
(:lmul!, :ft_execute_tri2cheb, Float64, 2, TRIANGLE),
880+
(:ldiv!, :ft_execute_cheb2tri, Float64, 2, TRIANGLE))
848881
@eval begin
849882
function $fJ(p::FTPlan{$T, $N, $K}, x::Array{$T, $N})
850883
checksize(p, x)

test/libfasttransformstests.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,12 @@ FastTransforms.set_num_threads(ceil(Int, Base.Sys.CPU_THREADS/2))
9090
C = ps*(p*A)
9191
A = p\(pa*C)
9292
@test A B
93+
C = ps'*(p'A)
94+
A = p'\(pa'C)
95+
@test A B
96+
C = transpose(ps)*(transpose(p)*A)
97+
A = transpose(p)\(transpose(pa)*C)
98+
@test A B
9399
end
94100

95101
A = sphones(Float64, n, 2n-1)
@@ -147,6 +153,7 @@ FastTransforms.set_num_threads(ceil(Int, Base.Sys.CPU_THREADS/2))
147153
pa = plan_tri_analysis(A)
148154
test_nd_plans(p, ps, pa, A)
149155

156+
α, β, γ, δ = -0.1, -0.2, -0.3, -0.4
150157
A = tetones(Float64, n, n, n)
151158
p = plan_tet2cheb(A, α, β, γ, δ)
152159
ps = plan_tet_synthesis(A)

0 commit comments

Comments
 (0)