| 36 | |
| 37 | template<typename inType, typename outType> |
| 38 | detail::Array<outType> fft_r2c(const detail::Array<inType> input, |
| 39 | const double norm_factor, const dim_t npad, |
| 40 | const dim_t *const pad, const int rank) { |
| 41 | using af::dim4; |
| 42 | using detail::Array; |
| 43 | using detail::fft_r2c; |
| 44 | using detail::multiply_inplace; |
| 45 | using detail::reshape; |
| 46 | using detail::scalar; |
| 47 | |
| 48 | const dim4 &idims = input.dims(); |
| 49 | |
| 50 | bool is_pad = false; |
| 51 | for (int i = 0; i < npad; i++) { is_pad |= (pad[i] != idims[i]); } |
| 52 | |
| 53 | Array<inType> tmp = input; |
| 54 | |
| 55 | if (is_pad) { |
| 56 | dim4 pdims(1); |
| 57 | computePaddedDims(pdims, input.dims(), npad, pad); |
| 58 | tmp = reshape(input, pdims, scalar<inType>(0)); |
| 59 | } |
| 60 | |
| 61 | auto res = fft_r2c<outType, inType>(tmp, rank); |
| 62 | if (norm_factor != 1.0) multiply_inplace(res, norm_factor); |
| 63 | |
| 64 | return res; |
| 65 | } |
| 66 | |
| 67 | template<typename inType, typename outType> |
| 68 | detail::Array<outType> fft_c2r(const detail::Array<inType> input, |
nothing calls this directly
no test coverage detected