Skip to content

Reduce type piracy by shifting methods to AbstractFFTs #24

@jishnub

Description

@jishnub

AbstractFFTs.complexfloat(x::StridedArray{Complex{<:AbstractFloat}}) = x
AbstractFFTs.realfloat(x::StridedArray{<:Real}) = x
# We override this one in order to avoid throwing an error that the type is
# unsupported (as defined in AbstractFFTs)
AbstractFFTs._fftfloat(::Type{T}) where {T <: AbstractFloat} = T
# We also avoid any conversion of types that are already AbstractFloat
# (since AbstractFFTs calls float(x) by default, which might change types)
AbstractFFTs.fftfloat(x::AbstractFloat) = x
# for compatibility with AbstractFFTs
AbstractFFTs.fftfloat(x::Float16) = Float32(x)

These should ideally be moved to AbstractFFTs to reduce the type-piracy in this package.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions