Commit 29813000 authored by Martin Reinecke's avatar Martin Reinecke
Browse files

synchronize with pocketfft C++

parent 61b41fca
/*
This file is part of pocketfft.
Copyright (C) 2010-2020 Max-Planck-Society
Copyright (C) 2010-2021 Max-Planck-Society
Copyright (C) 2019-2020 Peter Bell
For the odd-sized DCT-IV transforms:
......@@ -52,12 +52,12 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <stdexcept>
#include <memory>
#include <vector>
#include <complex>
#include <algorithm>
#if POCKETFFT_CACHE_SIZE!=0
#include <array>
#include <mutex>
......@@ -1302,9 +1302,9 @@ template<bool fwd, typename T> void pass11 (size_t ido, size_t l1,
}
}
#undef PARTSTEP11
#undef PARTSTEP11a0
#undef PARTSTEP11a
#undef POCKETFFT_PARTSTEP11
#undef POCKETFFT_PARTSTEP11a0
#undef POCKETFFT_PARTSTEP11a
#undef POCKETFFT_PREP11
template<bool fwd, typename T> void passg (size_t ido, size_t ip,
......@@ -1456,7 +1456,7 @@ template<bool fwd, typename T> void pass_all(T c[], T0 fct) const
for (size_t i=0; i<length; ++i)
c[i] = ch[i]*fct;
else
memcpy (c,p1,length*sizeof(T));
std::copy (p1, p1+length, c);
}
else
if (fct!=1.)
......@@ -2212,7 +2212,7 @@ template<typename T> void radbg(size_t ido, size_t ip, size_t l1,
for (size_t i=0; i<n; ++i)
c[i] = fct*p1[i];
else
memcpy (c,p1,n*sizeof(T));
std::copy (p1, p1+length, c);
}
else
if (fct!=1.)
......@@ -2437,13 +2437,12 @@ template<typename T0> class fftblue
tmp[m].Set(c[m], zero);
fft<true>(tmp.data(),fct);
c[0] = tmp[0].r;
memcpy (c+1, tmp.data()+1, (n-1)*sizeof(T));
std::copy (&tmp[1].r, &tmp[1].r+n-1, &c[1]);
}
else
{
tmp[0].Set(c[0],c[0]*0);
memcpy (reinterpret_cast<void *>(tmp.data()+1),
reinterpret_cast<void *>(c+1), (n-1)*sizeof(T));
std::copy (c+1, c+n, &tmp[1].r);
if ((n&1)==0) tmp[n/2].i=T0(0)*c[0];
for (size_t m=1; 2*m<n; ++m)
tmp[n-m].Set(tmp[m].r, -tmp[m].i);
......
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