Commit 98f1ac09 authored by Martin Reinecke's avatar Martin Reinecke

Merge branch 'no-exceptions' into 'new_norm'

Don't use exceptions as normal control flow

See merge request !9
parents 4e1f2c3b f4081806
......@@ -152,14 +152,11 @@ template<typename T> py::array sym_rfftn_internal(const py::array &in,
py::array fftn(const py::array &a, py::object axes, int inorm, bool inplace,
size_t nthreads)
{
try {
return xfftn(a, axes, inorm, inplace, true, nthreads);
}
catch (runtime_error &)
{
if (a.dtype().kind() == 'c')
return xfftn(a, axes, inorm, inplace, true, nthreads);
if (inplace) throw runtime_error("cannot do this operation in-place");
DISPATCH(a, f64, f32, flong, sym_rfftn_internal, (a, axes, inorm, nthreads))
}
}
py::array ifftn(const py::array &a, py::object axes, int inorm,
......
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