/
NFFT.jl
67 lines (52 loc) · 1.33 KB
/
NFFT.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
module NFFT
using Printf
using Base.Cartesian
using FFTW
using Distributed
using SparseArrays
using LinearAlgebra
using FLoops
import Base.size
using Reexport
using SpecialFunctions: besseli, besselj
using BasicInterpolators
#using StaticArrays
@reexport using AbstractNFFTs
export NDFTPlan, NDCTPlan, NDSTPlan, NNDFTPlan,
NFFTPlan, NFFTParams
#########################
# utility functions
#########################
include("utils.jl")
include("windowFunctions.jl")
#################################
# implementations
#################################
include("implementation.jl")
include("direct.jl")
include("precomputation.jl")
#################
# factory methods
#################
"""
plan_nfft(k::Matrix{T}, N::NTuple{D,Int}, rest...; kargs...)
compute a plan for the NFFT of a size-`N` array at the nodes contained in `k`.
"""
function AbstractNFFTs.plan_nfft(::Type{<:Array}, k::Matrix{T}, N::NTuple{D,Int}, rest...;
timing::Union{Nothing,TimingStats} = nothing, kargs...) where {T,D}
t = @elapsed begin
p = NFFTPlan(k, N, rest...; kargs...)
end
if timing != nothing
timing.pre = t
end
return p
end
include("directional.jl")
include("deconvolution.jl")
include("convolution.jl")
function __init__()
NFFT._use_threads[] = (Threads.nthreads() > 1)
end
include("precompile.jl")
end