Skip to content

Commit 5d85f76

Browse files
committed
Fix "c" vector bug in nufft2.
1 parent 51074c7 commit 5d85f76

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/nufft.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
function nufft1_plan{T<:AbstractFloat}( x::AbstractVector{T}, ϵ::T )
2-
#(s_vec, t_idx, γ) = FindAlgorithmicParameters( x )
2+
33
t_idx = AssignClosestEquispacedFFTpoint( x )
44
γ = PerturbationParameter( x, AssignClosestEquispacedGridpoint( x ) )
55
K = FindK(γ, ϵ)
@@ -9,13 +9,14 @@ p( c ) = (u.*(fft(Diagonal(c)*v,1)[t_idx,:]))*ones(K)
99
end
1010

1111
function nufft2_plan{T<:AbstractFloat}( ω::AbstractVector{T}, ϵ::T )
12+
1213
N = size(ω, 1)
1314
t_idx = AssignClosestEquispacedFFTpoint( ω/N )
1415
γ = PerturbationParameter( ω/N, AssignClosestEquispacedGridpoint( ω/N ) )
1516
K = FindK(γ, ϵ)
1617
u = constructU( ω/N, K)
1718
v = constructV( ω/N, K)
18-
In = speye(eltype(c), N, N)
19+
In = speye(Complex{T}, N, N)
1920
p( c ) = (v.*(N*conj(ifft(In[:,t_idx]*conj(Diagonal(c)*u),1))))*ones(K)
2021
end
2122

@@ -49,7 +50,7 @@ N = size(x, 1)
4950
v = complex(ChebyshevP(K-1, 2.0*collect(0:N-1)/N - ones(N) ))
5051
end
5152

52-
function Bessel_coeffs(K::Int64, γ::Float64)::Array{Complex{Float64},2}
53+
function Bessel_coeffs{T<:AbstractFloat}(K::Int64, γ::T)::Array{Complex{T},2}
5354
# Calculate the Chebyshev coefficients of exp(-2*pi*1im*x*y) on [-gam,gam]x[0,1]
5455

5556
cfs = complex(zeros( K, K ))

0 commit comments

Comments
 (0)