Skip to content

Type inconsistencies with FFTW? #14

@milankl

Description

@milankl

FFTW plans are <:AbstractFFTs.Plan{T} with T complex for complex-to-real plans and T real for real-to-complex plans. So the parametric type of the plan is the type of the input. However, the plans here always seem to be <:AbstractFFTs.Plan{Complex}. Is that on purpose?

julia> generic_plan = GenericFFT.plan_rfft(zeros(Float16,64))
GenericFFT.DummyrFFTPlan{ComplexF16, false, UnitRange{Int64}}(64, 1:1, #undef)

julia> fftw_plan = FFTW.plan_rfft(zeros(64))
FFTW real-to-complex plan for 64-element array of Float64
(rdft2-ct-dit/8
  (hc2c-direct-8/28/1 "hc2cfdftv_8_avx2"
    (rdft2-r2hc-direct-8 "r2cf_8")
    (rdft2-r2hc01-direct-8 "r2cfII_8"))
  (dft-direct-8-x4 "n2fv_8_avx2_128"))

julia> supertype(supertype(typeof(fftw_plan)))
AbstractFFTs.Plan{Float64}

julia> supertype(supertype(typeof(generic_plan)))
AbstractFFTs.Plan{ComplexF16}     # expected Float16 not ComplexF16

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions