JuliaMath / NFFT.jl

Julia implementation of the Non-equidistant Fast Fourier Transform (NFFT)
Other
153 stars 28 forks source link

copy(adjoint(p::NFFTPlan)) not working #91

Closed JakobAsslaender closed 2 years ago

JakobAsslaender commented 2 years ago

Hi, the copy function does not seem to work for adjoint(p):

julia> using NFFT

julia> p = NFFT.NFFTPlan(rand(3,100) .- 1/2, (128,128,128))
NFFTPlan with 100 sampling points for an input array of size(128, 128, 128) and an output array of size(100,) with dims 1:3

julia> pa = adjoint(p);

julia> pa2 = copy(pa)
ERROR: MethodError: no method matching similar(::NFFTPlan{Float64, 3, 1}, ::Type{ComplexF64}, ::Tuple{Base.OneTo{Int64}, Base.OneTo{Int64}})
Closest candidates are:
  similar(::Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{N}}, ::Type{ElType}, ::Any) where {N, ElType} at /gpfs/scratch/asslaj01/julia-1.7.2/share/julia/base/broadcast.jl:212
  similar(::Base.Broadcast.Broadcasted{Base.Broadcast.ArrayConflict}, ::Type{ElType}, ::Any) where ElType at /gpfs/scratch/asslaj01/julia-1.7.2/share/julia/base/broadcast.jl:217
  similar(::AbstractArray, ::Type{T}, ::Tuple{Union{Integer, Base.OneTo}, Vararg{Union{Integer, Base.OneTo}}}) where T at /gpfs/scratch/asslaj01/julia-1.7.2/share/julia/base/abstractarray.jl:791
  ...
Stacktrace:
 [1] similar(A::LinearAlgebra.Adjoint{ComplexF64, NFFTPlan{Float64, 3, 1}})
   @ LinearAlgebra /gpfs/scratch/asslaj01/julia-1.7.2/share/julia/stdlib/v1.7/LinearAlgebra/src/adjtrans.jl:209
 [2] copymutable
   @ ./abstractarray.jl:1129 [inlined]
 [3] copy(a::LinearAlgebra.Adjoint{ComplexF64, NFFTPlan{Float64, 3, 1}})
   @ Base ./abstractarray.jl:1073
 [4] top-level scope
   @ REPL[4]:1
tknopp commented 2 years ago

Thanks, fixed.