Re: [eigen] Problem with fft and custom allocator |

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]

*To*: eigen@xxxxxxxxxxxxxxxxxxx*Subject*: Re: [eigen] Problem with fft and custom allocator*From*: Marc Glisse <marc.glisse@xxxxxxxx>*Date*: Mon, 28 Mar 2016 23:57:59 +0200 (CEST)

On Mon, 28 Mar 2016, Matthias Pospiech wrote:

Am 27.03.2016 um 22:58 schrieb Matthias Pospiech:Hello, I am using the FFT of eigen, however with a custom allocator. The custom one is based on the code from Nicolai M. Josuttis http://www.josuttis.com/libbook/memory/myalloc.hpp.html 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: voidfwd(std::vector<Complex,fftalloc<Complex>>&dst,constvector<_Input,fftalloc<_Input>>&src) voidinv(std::vector<_Output,fftalloc<_Output>>&dst,conststd::vector<Complex,fftalloc<Complex>>&src,Indexnfft=-1) it compiles now and the result of ifft(fft(A)) differs now from A by << 1e-16The only restriction is now, that either non or both arrays must be definedwith or without the extra allocator.

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

**Follow-Ups**:**Re: [eigen] Problem with fft and custom allocator***From:*Gael Guennebaud

**References**:**[eigen] Problem with fft and custom allocator***From:*Matthias Pospiech

**Re: [eigen] Problem with fft and custom allocator***From:*Matthias Pospiech

**Messages sorted by:**[ date | thread ]- Prev by Date:
**Re: [eigen] Problem with fft and custom allocator** - Next by Date:
**[eigen] Support for trace of tensors** - Previous by thread:
**Re: [eigen] Problem with fft and custom allocator** - Next by thread:
**Re: [eigen] Problem with fft and custom allocator**

Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |