Skip to content

Applying a complex in-place plan via '*' to a real vector should throw #341

Description

@j-fu

My colleague sent me this MWE - it is about defining a complex in-place plan.
This should mutate vectors when applied via '*' as documented.
When applying this to a vector of floats it should throw, but in fact it
returns a complex vector but does not mutate the the vector.

using FFTW

plan = plan_fft!(zeros(ComplexF64, 4))
vec1 = ComplexF64[1,1,1,1]
vec2 = [1,1,1,1]

# changes vec1 as expected
plan * vec1; println(vec1,"\n")

# sends error as expected
try
    FFTW.mul!(vec2, plan, vec2)
catch e;
    println(e,"\n")
end

# does not say anything and does not change vec2
plan * vec2; println(vec2,"\n")

PR follows.

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