MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / fft_r2c

Function fft_r2c

src/api/c/fft_common.hpp:38–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36
37template<typename inType, typename outType>
38detail::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
67template<typename inType, typename outType>
68detail::Array<outType> fft_c2r(const detail::Array<inType> input,

Callers

nothing calls this directly

Calls 4

computePaddedDimsFunction · 0.85
reshapeFunction · 0.50
multiply_inplaceFunction · 0.50
dimsMethod · 0.45

Tested by

no test coverage detected