1
1
function nufft1_plan {T<:AbstractFloat} ( x:: AbstractVector{T} , ϵ:: T )
2
- # (s_vec, t_idx, γ) = FindAlgorithmicParameters( x )
2
+
3
3
t_idx = AssignClosestEquispacedFFTpoint ( x )
4
4
γ = PerturbationParameter ( x, AssignClosestEquispacedGridpoint ( x ) )
5
5
K = FindK (γ, ϵ)
@@ -9,13 +9,14 @@ p( c ) = (u.*(fft(Diagonal(c)*v,1)[t_idx,:]))*ones(K)
9
9
end
10
10
11
11
function nufft2_plan {T<:AbstractFloat} ( ω:: AbstractVector{T} , ϵ:: T )
12
+
12
13
N = size (ω, 1 )
13
14
t_idx = AssignClosestEquispacedFFTpoint ( ω/ N )
14
15
γ = PerturbationParameter ( ω/ N, AssignClosestEquispacedGridpoint ( ω/ N ) )
15
16
K = FindK (γ, ϵ)
16
17
u = constructU ( ω/ N, K)
17
18
v = constructV ( ω/ N, K)
18
- In = speye (eltype (c) , N, N)
19
+ In = speye (Complex{T} , N, N)
19
20
p ( c ) = (v.* (N* conj (ifft (In[:,t_idx]* conj (Diagonal (c)* u),1 ))))* ones (K)
20
21
end
21
22
@@ -49,7 +50,7 @@ N = size(x, 1)
49
50
v = complex (ChebyshevP (K- 1 , 2.0 * collect (0 : N- 1 )/ N - ones (N) ))
50
51
end
51
52
52
- function Bessel_coeffs (K:: Int64 , γ:: Float64 ):: Array{Complex{Float64 },2}
53
+ function Bessel_coeffs {T<:AbstractFloat} (K:: Int64 , γ:: T ):: Array{Complex{T },2}
53
54
# Calculate the Chebyshev coefficients of exp(-2*pi*1im*x*y) on [-gam,gam]x[0,1]
54
55
55
56
cfs = complex (zeros ( K, K ))
0 commit comments