Re: [eigen] Problem with fft and custom allocator

[ Thread Index | Date Index | More Archives ]

I agree with Marc. Feel free to propose a patch that follows this suggestion.

Furthermore, looking at the FFT class, you can also by pass these two overloads and directly call:

 fwd(,, nfft);


On Mon, Mar 28, 2016 at 11:57 PM, Marc Glisse <marc.glisse@xxxxxxxx> wrote:
On Mon, 28 Mar 2016, Matthias Pospiech wrote:

Am 27.03.2016 um 22:58 schrieb Matthias Pospiech:
I am using the FFT of eigen, however with a custom allocator.
The custom one is based on the code from Nicolai M. Josuttis
with fftw_malloc and fftw_free instead of new and delete.
The class is called fftalloc.

This simple code however fails:
std::vector<complex<double>,fftalloc<complex<double>>>data(N); std::vector<complex<double>,fftalloc<complex<double>>>dataFourier(N); FFT<double>fft; fft.fwd(dataFourier,data);

I solved it by defining a new set of functions:


it compiles now and the result of ifft(fft(A)) differs now from A by << 1e-16

The only restriction is now, that either non or both arrays must be defined with or without the extra allocator.

I probably missed something obvious because I don't know that code, but from what you posted, I wonder why you are not making the allocator a template parameter:

template<typename _Input,class A1,class A2>
void fwd(std::vector<Complex,A1>&dst,const std::vector<_Input,A2>&src);

Marc Glisse

Mail converted by MHonArc 2.6.19+