Does pyFFTW allow to preserve the input array

Yes, all the defaults are used unless explicitly requested – this means that unless you request DESTROY_INPUT, then PRESERVE_INPUT is implicit, except in the case where you have a multi-dimensional c2r transform, in which case the input will be destroyed (this is documented in the Schemes section of the documentation you linked to, as well as the FFTW docs you linked to).

If you find a case where the input is destroyed and it is not either explicitly requested as such or is not one of the above transforms, this is a bug and should be reported.

The interfaces code makes various copies to make sure transforms are preserved when necessary.

My recollection is the planning stage is much looser about protecting arrays – the easiest way of protecting the array is to use the builders interface which, unless explicitly advised otherwise, will always store the original array and copy it back in.

Read more here: Source link