22 #include <tensor/fftw.h>
24 #include "fftw_common.hpp"
29 fftw(
const CTensor &in,
int direction)
31 CTensor out(in.dimensions());
34 const_cast<fftw_complex*
>
35 (
reinterpret_cast<const fftw_complex*
> (in.begin()));
36 fftw_complex *pout =
reinterpret_cast<fftw_complex*
> (out.begin());
37 do_fftw(pin, pout, in.dimensions(), direction);
43 fftw(
const CTensor& in, index dim,
int direction) {
44 assert(dim >=0 && dim < in.rank());
45 CTensor out(in.dimensions());
48 const_cast<fftw_complex*
>
49 (
reinterpret_cast<const fftw_complex*
> (in.begin()));
50 fftw_complex *pout =
reinterpret_cast<fftw_complex*
> (out.begin());
51 do_fftw(pin, pout, dim, in.dimensions(), direction);
57 fftw(
const CTensor& in,
const Booleans& convert,
int direction) {
58 assert(convert.size() == in.rank());
59 CTensor out(in.dimensions());
62 const_cast<fftw_complex*
>
63 (
reinterpret_cast<const fftw_complex*
> (in.begin()));
64 fftw_complex *pout =
reinterpret_cast<fftw_complex*
> (out.begin());
65 do_fftw(pin, pout, convert, in.dimensions(), direction);