@@ -6,21 +6,28 @@ const PlanPtr = Ptr{ft_plan_struct}
6
6
function c_plan_tri2cheb end
7
7
function c_tri2cheb end
8
8
function c_cheb2tri end
9
+ function c_plan_disk2cxf end
10
+ function c_disk2cxf end
11
+ function c_cxf2disk end
9
12
10
13
if Libdl. find_library (libfasttransforms) ≡ libfasttransforms
11
14
ft_set_threads (n:: Int ) = ccall ((:omp_set_num_threads , libfasttransforms), Nothing, (Int, ), n)
12
15
ft_set_threads (Sys. CPU_THREADS)
13
16
14
- c_plan_sph2fourier (n:: Int ) = ccall ((:ft_plan_sph2fourier , libfasttransforms), PlanPtr, (Int64 , ), n)
15
- fc_sph2fourier (P:: PlanPtr , A:: Matrix{Float64} ) = ccall ((:ft_execute_sph2fourier , libfasttransforms), Nothing, (PlanPtr, Ptr{Float64}, Int64, Int64 ), P, A, size (A, 1 ), size (A, 2 ))
17
+ c_plan_sph2fourier (n:: Int ) = ccall ((:ft_plan_sph2fourier , libfasttransforms), PlanPtr, (Int , ), n)
18
+ fc_sph2fourier (P:: PlanPtr , A:: Matrix{Float64} ) = ccall ((:ft_execute_sph2fourier , libfasttransforms), Nothing, (PlanPtr, Ptr{Float64}, Int, Int ), P, A, size (A, 1 ), size (A, 2 ))
16
19
17
- c_plan_rottriangle (n:: Int , α:: Float64 , β:: Float64 , γ:: Float64 ) = ccall ((:ft_plan_rottriangle , libfasttransforms), PlanPtr, (Int64 , Float64, Float64, Float64), n, α, β, γ)
18
- c_execute_tri_hi2lo (P:: PlanPtr , A:: Matrix{Float64} ) = ccall ((:ft_execute_tri_hi2lo , libfasttransforms), Nothing, (PlanPtr, Ptr{Float64}, Int64 ), P, A, size (A, 2 ))
19
- c_execute_tri_lo2hi (P:: PlanPtr , A:: Matrix{Float64} ) = ccall ((:ft_execute_tri_lo2hi , libfasttransforms), Nothing, (PlanPtr, Ptr{Float64}, Int64 ), P, A, size (A, 2 ))
20
+ c_plan_rottriangle (n:: Int , α:: Float64 , β:: Float64 , γ:: Float64 ) = ccall ((:ft_plan_rottriangle , libfasttransforms), PlanPtr, (Int , Float64, Float64, Float64), n, α, β, γ)
21
+ c_execute_tri_hi2lo (P:: PlanPtr , A:: Matrix{Float64} ) = ccall ((:ft_execute_tri_hi2lo , libfasttransforms), Nothing, (PlanPtr, Ptr{Float64}, Int ), P, A, size (A, 2 ))
22
+ c_execute_tri_lo2hi (P:: PlanPtr , A:: Matrix{Float64} ) = ccall ((:ft_execute_tri_lo2hi , libfasttransforms), Nothing, (PlanPtr, Ptr{Float64}, Int ), P, A, size (A, 2 ))
20
23
21
- c_plan_tri2cheb (n:: Int , α:: Float64 , β:: Float64 , γ:: Float64 ) = ccall ((:ft_plan_tri2cheb , libfasttransforms), PlanPtr, (Int64, Float64, Float64, Float64), n, α, β, γ)
22
- c_tri2cheb (P:: PlanPtr , A:: Matrix{Float64} ) = ccall ((:ft_execute_tri2cheb , libfasttransforms), Nothing, (PlanPtr, Ptr{Float64}, Int64, Int64), P, A, size (A, 1 ), size (A, 2 ))
23
- c_cheb2tri (P:: PlanPtr , A:: Matrix{Float64} ) = ccall ((:ft_execute_cheb2tri , libfasttransforms), Nothing, (PlanPtr, Ptr{Float64}, Int64, Int64), P, A, size (A, 1 ), size (A, 2 ))
24
+ c_plan_tri2cheb (n:: Int , α:: Float64 , β:: Float64 , γ:: Float64 ) = ccall ((:ft_plan_tri2cheb , libfasttransforms), PlanPtr, (Int, Float64, Float64, Float64), n, α, β, γ)
25
+ c_tri2cheb (P:: PlanPtr , A:: Matrix{Float64} ) = ccall ((:ft_execute_tri2cheb , libfasttransforms), Nothing, (PlanPtr, Ptr{Float64}, Int, Int), P, A, size (A, 1 ), size (A, 2 ))
26
+ c_cheb2tri (P:: PlanPtr , A:: Matrix{Float64} ) = ccall ((:ft_execute_cheb2tri , libfasttransforms), Nothing, (PlanPtr, Ptr{Float64}, Int, Int), P, A, size (A, 1 ), size (A, 2 ))
27
+
28
+ c_plan_disk2cxf (n:: Int ) = ccall ((:ft_plan_disk2cxf , libfasttransforms), PlanPtr, (Int,), n)
29
+ c_disk2cxf (P:: PlanPtr , A:: Matrix{Float64} ) = ccall ((:ft_execute_disk2cxf , libfasttransforms), Nothing, (PlanPtr, Ptr{Float64}, Int, Int), P, A, size (A, 1 ), size (A, 2 ))
30
+ c_cxf2disk (P:: PlanPtr , A:: Matrix{Float64} ) = ccall ((:ft_execute_cxf2disk , libfasttransforms), Nothing, (PlanPtr, Ptr{Float64}, Int, Int), P, A, size (A, 1 ), size (A, 2 ))
24
31
else
25
32
@warn " Cannot load FastTransforms Dylib"
26
33
end
@@ -33,9 +40,8 @@ struct CTri2ChebPlan
33
40
γ:: Float64
34
41
end
35
42
36
- function CTri2ChebPlan (n:: Int , α:: Float64 , β:: Float64 , γ:: Float64 )
43
+ CTri2ChebPlan (n:: Int , α:: Float64 , β:: Float64 , γ:: Float64 ) =
37
44
CTri2ChebPlan (c_plan_tri2cheb (n, α, β, γ), n, α, β, γ)
38
- end
39
45
40
46
function * (C:: CTri2ChebPlan , A:: Matrix{Float64} )
41
47
size (A,1 ) == size (A,2 ) == C. n || throw (ArgumentError (A))
@@ -50,3 +56,25 @@ function \(C::CTri2ChebPlan, A::Matrix{Float64})
50
56
c_cheb2tri (C. plan, B)
51
57
B
52
58
end
59
+
60
+
61
+ struct CDisk2CxfPlan
62
+ plan:: PlanPtr
63
+ n:: Int
64
+ end
65
+
66
+ CDisk2CxfPlan (n:: Int ) = CDisk2CxfPlan (c_plan_disk2cxf (n), n)
67
+
68
+ function * (C:: CDisk2CxfPlan , A:: Matrix{Float64} )
69
+ (size (A,1 ) == C. n+ 1 && size (A,2 ) == 4 C. n+ 1 ) || throw (ArgumentError (A))
70
+ B = copy (A)
71
+ c_disk2cxf (C. plan, B)
72
+ B
73
+ end
74
+
75
+ function \ (C:: CDisk2CxfPlan , A:: Matrix{Float64} )
76
+ (size (A,1 ) == C. n && size (A,2 ) == 4 C. n- 3 ) || throw (DimensionMismatch (" " ))
77
+ B = copy (A)
78
+ c_cxf2disk (C. plan, B)
79
+ B
80
+ end
0 commit comments