# Five argument mul! in FFTW

**URL:** https://discourse.julialang.org/t/five-argument-mul-in-fftw/35443
**Category:** Numerics
**Tags:** question
**Created:** [March 3, 2020, 7:35am UTC](https://discourse.julialang.org/t/five-argument-mul-in-fftw/35443 "2020-03-03T07:35:03Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![ranocha](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ranocha/32/35588_2.png) [@ranocha](https://discourse.julialang.org/u/ranocha)
#### Post date: [March 3, 2020, 7:35am UTC](https://discourse.julialang.org/t/five-argument-mul-in-fftw/35443/1 "2020-03-03T07:35:03Z")

</div>

I couldn’t find a 5 argument method of `mul!` in [FFTW.jl](https://github.com/JuliaMath/FFTW.jl) for `FFTW.rFFTWPlan` and its siblings. Would it be reasonable to add such methods? In particular, I would like to be able to do something like

```julia
julia> using LinearAlgebra, FFTW

julia> x = Vector(range(0., 1., length=16));

julia> rfft_plan = plan_rfft(x);

julia> y = rfft_plan * x; y .= 1;

julia> mul!(y, rfft_plan, x);

julia> mul!(y, rfft_plan, x, 1.0, 0.5) # this yields a MethodError

```

---

<div class="post-metadata">

### Author: ![cpross90](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cpross90/32/10142_2.png) [@cpross90](https://discourse.julialang.org/u/cpross90)
#### Post date: [May 9, 2020, 9:45pm UTC](https://discourse.julialang.org/t/five-argument-mul-in-fftw/35443/2 "2020-05-09T21:45:42Z")

</div>

Can you help by describing what you’re trying to accomplish with the 2 arguments in your mul! call?

I think that the answer to your question however is no, but there might be an inplace approach for what you’re trying to do.

I’m also unsure what the third line of code is accomplishing, are you trying to allocate a temporary so that you can use the in place mul function below?

---

<div class="post-metadata">

### Author: ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)
#### Post date: [May 9, 2020, 10:07pm UTC](https://discourse.julialang.org/t/five-argument-mul-in-fftw/35443/3 "2020-05-09T22:07:33Z")

</div>

> [@ranocha](#):
>
> I couldn’t find a 5 argument method of `mul!` in [FFTW.jl](https://github.com/JuliaMath/FFTW.jl) for `FFTW.rFFTWPlan` and its siblings. Would it be reasonable to add such methods?

The underlying FFTW library doesn’t support these operations, so any implementation would be no better than what you would implement on your own.

---

<div class="post-metadata">

### Author: ![ranocha](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ranocha/32/35588_2.png) [@ranocha](https://discourse.julialang.org/u/ranocha)
#### Post date: [May 10, 2020, 10:01am UTC](https://discourse.julialang.org/t/five-argument-mul-in-fftw/35443/4 "2020-05-10T10:01:58Z")

</div>

Cross reference: [Five argument mul! · Issue #139 · JuliaMath/FFTW.jl · GitHub](https://github.com/JuliaMath/FFTW.jl/issues/139)  
As described by stevengj, such a functionality is not implemented in FFTW and thus not available in Julia.
