1- export FFTOp
1+ export FFTOpImpl
22import Base. copy
33
4- mutable struct FFTOp{T} <: AbstractLinearOperator{T}
4+ function LinearOperatorCollection. constructLinearOperator (:: Type{Op} ;
5+ shape:: Tuple , shift:: Bool = true , unitary:: Bool = true , cuda:: Bool = false ) where Op <: FFTOp{T} where T <: Number
6+ return FFTOpImpl (T, shape, shift; unitary, cuda)
7+ end
8+
9+ mutable struct FFTOpImpl{T} <: AbstractLinearOperatorFromCollection{T}
510 nrow :: Int
611 ncol :: Int
712 symmetric :: Bool
@@ -23,10 +28,10 @@ mutable struct FFTOp{T} <: AbstractLinearOperator{T}
2328 unitary:: Bool
2429end
2530
26- LinearOperators. storage_type (op:: FFTOp ) = typeof (op. Mv5)
31+ LinearOperators. storage_type (op:: FFTOpImpl ) = typeof (op. Mv5)
2732
2833"""
29- FFTOp (T::Type, shape::Tuple, shift=true, unitary=true)
34+ FFTOpImpl (T::Type, shape::Tuple, shift=true, unitary=true)
3035
3136returns an operator which performs an FFT on Arrays of type T
3237
@@ -36,7 +41,7 @@ returns an operator which performs an FFT on Arrays of type T
3641* (`shift=true`) - if true, fftshifts are performed
3742* (`unitary=true`) - if true, FFT is normalized such that it is unitary
3843"""
39- function FFTOp (T:: Type , shape:: NTuple{D,Int64} , shift:: Bool = true ; unitary:: Bool = true , cuda:: Bool = false ) where D
44+ function FFTOpImpl (T:: Type , shape:: NTuple{D,Int64} , shift:: Bool = true ; unitary:: Bool = true , cuda:: Bool = false ) where D
4045
4146 # tmpVec = cuda ? CuArray{T}(undef,shape) : Array{Complex{real(T)}}(undef, shape)
4247 tmpVec = Array {Complex{real(T)}} (undef, shape)
@@ -54,7 +59,7 @@ function FFTOp(T::Type, shape::NTuple{D,Int64}, shift::Bool=true; unitary::Bool=
5459 let shape_= shape, plan_= plan, iplan_= iplan, tmpVec_= tmpVec, facF_= facF, facB_= facB
5560
5661 if shift
57- return FFTOp {T} (prod (shape), prod (shape), false , false
62+ return FFTOpImpl {T} (prod (shape), prod (shape), false , false
5863 , (res, x) -> fft_multiply_shift! (res, plan_, x, shape_, facF_, tmpVec_)
5964 , nothing
6065 , (res, x) -> fft_multiply_shift! (res, iplan_, x, shape_, facB_, tmpVec_)
@@ -64,7 +69,7 @@ function FFTOp(T::Type, shape::NTuple{D,Int64}, shift::Bool=true; unitary::Bool=
6469 , shift
6570 , unitary)
6671 else
67- return FFTOp {T} (prod (shape), prod (shape), false , false
72+ return FFTOpImpl {T} (prod (shape), prod (shape), false , false
6873 , (res, x) -> fft_multiply! (res, plan_, x, facF_, tmpVec_)
6974 , nothing
7075 , (res, x) -> fft_multiply! (res, iplan_, x, facB_, tmpVec_)
@@ -91,6 +96,6 @@ function fft_multiply_shift!(res::AbstractVector{T}, plan::P, x::AbstractVector{
9196end
9297
9398
94- function Base. copy (S:: FFTOp )
95- return FFTOp (eltype (S), size (S. plan), S. shift, unitary= S. unitary)
99+ function Base. copy (S:: FFTOpImpl )
100+ return FFTOpImpl (eltype (S), size (S. plan), S. shift, unitary= S. unitary)
96101end
0 commit comments