You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Taking care of the discussed changes with respect to the dtype keyword argument, I noticed that the out-of-place nufftndm calls essentially validate their arguments twice since valid_setpts, valid_ntr, and checkkwdtype are called a second time within the nufftndm! functions. Wouldn't it make sense to remove these checks from the out-of-place functions and simplify them to something like the following?
function nufft3d3(xj :: Array{T},
yj :: Array{T},
zj :: Array{T},
cj :: Array{Complex{T}},
iflag :: Integer,
eps :: Real,
sk :: Array{T},
tk :: Array{T},
uk :: Array{T};
kwargs...) where T <: finufftReal
ntrans = valid_ntr(xj,cj)
fk = Array{Complex{T}}(undef, nk, ntrans)
nufft3d3!(xj, yj, zj, cj, iflag, eps, sk, tk, uk, fk; kwargs...)
return fk
end
Currently, the function looks like
function nufft3d3(xj :: Array{T},
yj :: Array{T},
zj :: Array{T},
cj :: Array{Complex{T}},
iflag :: Integer,
eps :: Real,
sk :: Array{T},
tk :: Array{T},
uk :: Array{T};
kwargs...) where T <: finufftReal
(nj, nk) = valid_setpts(3,3,xj,yj,zj,sk,tk,uk)
ntrans = valid_ntr(xj,cj)
fk = Array{Complex{T}}(undef, nk, ntrans)
checkkwdtype(T; kwargs...)
nufft3d3!(xj, yj, zj, cj, iflag, eps, sk, tk, uk, fk;kwargs...)
return fk
end
with the in-place method
function nufft3d3!(xj :: Array{T},
yj :: Array{T},
zj :: Array{T},
cj :: Array{Complex{T}},
iflag :: Integer,
eps :: Real,
sk :: Array{T},
tk :: Array{T},
uk :: Array{T},
fk :: Array{Complex{T}};
kwargs...) where T <: finufftReal
(nj, nk) = valid_setpts(3,3,xj,yj,zj,sk,tk,uk)
ntrans = valid_ntr(xj,cj)
checkkwdtype(T; kwargs...)
plan = finufft_makeplan(3,3,iflag,ntrans,eps;dtype=T,kwargs...)
finufft_setpts!(plan,xj,yj,zj,sk,tk,uk)
finufft_exec!(plan,cj,fk)
ret = finufft_destroy!(plan)
check_ret(ret)
end
The text was updated successfully, but these errors were encountered:
Taking care of the discussed changes with respect to the
dtype
keyword argument, I noticed that the out-of-placenufftndm
calls essentially validate their arguments twice sincevalid_setpts
,valid_ntr
, andcheckkwdtype
are called a second time within thenufftndm!
functions. Wouldn't it make sense to remove these checks from the out-of-place functions and simplify them to something like the following?Currently, the function looks like
with the in-place method
The text was updated successfully, but these errors were encountered: