Commit b0b3677a authored by Martin Reinecke's avatar Martin Reinecke


parent 5836cc16
......@@ -2464,12 +2464,11 @@ template<typename T> py::array irfftn_internal(const py::array &in,
if (lastsize==0) lastsize=2*inter.shape(axis)-1;
if (int64_t(lastsize/2) + 1 != inter.shape(axis))
throw runtime_error("bad lastsize");
auto dims_in(copy_shape(inter)), dims_out(dims_in);
auto dims_out(copy_shape(inter));
dims_out[axis] = lastsize;
py::array res = py::array_t<T>(dims_out);
auto s_i(copy_strides(inter)), s_o(copy_strides(res));
pocketfft_general_c2r<T>(dims_out, s_i, s_o, axis,
(const cmplx<T> *), (T *)res.mutable_data(), fct);
pocketfft_general_c2r<T>(dims_out, copy_strides(inter), copy_strides(res),
axis, (const cmplx<T> *), (T *)res.mutable_data(), fct);
return res;
py::array irfftn(const py::array &in, py::object axes_, size_t lastsize,
......@@ -2483,12 +2482,10 @@ py::array irfftn(const py::array &in, py::object axes_, size_t lastsize,
template<typename T> py::array hartley_internal(const py::array &in,
py::object axes_, double fct, bool inplace)
auto axes(makeaxes(in, axes_));
auto dims(copy_shape(in));
py::array res = inplace ? in : py::array_t<T>(dims);
auto s_i(copy_strides(in)), s_o(copy_strides(res));
pocketfft_general_hartley<T>(dims, s_i, s_o, axes, (const T *),
(T *)res.mutable_data(), fct);
pocketfft_general_hartley<T>(dims, copy_strides(in), copy_strides(res),
makeaxes(in, axes_), (const T *), (T *)res.mutable_data(), fct);
return res;
py::array hartley(const py::array &in, py::object axes_, double fct,
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment