Commit 732b25fa authored by Martin Reinecke's avatar Martin Reinecke
Browse files

cosmetics

parent 760a49ee
...@@ -497,8 +497,8 @@ struct util // hack to avoid duplicate symbols ...@@ -497,8 +497,8 @@ struct util // hack to avoid duplicate symbols
return (nthreads==0) ? size_t(omp_get_max_threads()) : nthreads; return (nthreads==0) ? size_t(omp_get_max_threads()) : nthreads;
} }
#else #else
static size_t nthreads() { return 1; } static constexpr size_t nthreads() { return 1; }
static size_t thread_num() { return 0; } static constexpr size_t thread_num() { return 0; }
#endif #endif
}; };
...@@ -2014,8 +2014,9 @@ template<typename T0> class fftblue ...@@ -2014,8 +2014,9 @@ template<typename T0> class fftblue
/* initialize a_k and FFT it */ /* initialize a_k and FFT it */
for (size_t m=0; m<n; ++m) for (size_t m=0; m<n; ++m)
akf[m] = c[m].template special_mul<bwd>(bk[m]); akf[m] = c[m].template special_mul<bwd>(bk[m]);
auto zero = akf[0]*T0(0);
for (size_t m=n; m<n2; ++m) for (size_t m=n; m<n2; ++m)
akf[m]=akf[0]*T0(0); akf[m]=zero;
plan.forward (akf.data(),1.); plan.forward (akf.data(),1.);
...@@ -2082,8 +2083,9 @@ template<typename T0> class fftblue ...@@ -2082,8 +2083,9 @@ template<typename T0> class fftblue
template<typename T> void forward_r(T c[], T0 fct) template<typename T> void forward_r(T c[], T0 fct)
{ {
arr<cmplx<T>> tmp(n); arr<cmplx<T>> tmp(n);
auto zero = T0(0)*c[0];
for (size_t m=0; m<n; ++m) for (size_t m=0; m<n; ++m)
tmp[m].Set(c[m], T0(0)*c[m]); tmp[m].Set(c[m], zero);
fft<false>(tmp.data(),fct); fft<false>(tmp.data(),fct);
c[0] = tmp[0].r; c[0] = tmp[0].r;
memcpy (c+1, tmp.data()+1, (n-1)*sizeof(T)); memcpy (c+1, tmp.data()+1, (n-1)*sizeof(T));
...@@ -2708,7 +2710,7 @@ template<typename T> NOINLINE void general_c2r( ...@@ -2708,7 +2710,7 @@ template<typename T> NOINLINE void general_c2r(
if (forward) if (forward)
for (; i<len-1; i+=2, ++ii) for (; i<len-1; i+=2, ++ii)
{ {
tdata[i ] = in[it.iofs(ii)].r; tdata[i ] = in[it.iofs(ii)].r;
tdata[i+1] = -in[it.iofs(ii)].i; tdata[i+1] = -in[it.iofs(ii)].i;
} }
else else
...@@ -2896,7 +2898,8 @@ template<typename T> void c2r(const shape_t &shape_out, ...@@ -2896,7 +2898,8 @@ template<typename T> void c2r(const shape_t &shape_out,
stride_t stride_inter(shape_in.size()); stride_t stride_inter(shape_in.size());
stride_inter.back() = sizeof(cmplx<T>); stride_inter.back() = sizeof(cmplx<T>);
for (int i=int(shape_in.size())-2; i>=0; --i) for (int i=int(shape_in.size())-2; i>=0; --i)
stride_inter[size_t(i)] = stride_inter[size_t(i+1)]*ptrdiff_t(shape_in[size_t(i+1)]); stride_inter[size_t(i)] =
stride_inter[size_t(i+1)]*ptrdiff_t(shape_in[size_t(i+1)]);
arr<complex<T>> tmp(nval); arr<complex<T>> tmp(nval);
auto newaxes = shape_t({axes.begin(), --axes.end()}); auto newaxes = shape_t({axes.begin(), --axes.end()});
c2c(shape_in, stride_in, stride_inter, newaxes, forward, data_in, tmp.data(), c2c(shape_in, stride_in, stride_inter, newaxes, forward, data_in, tmp.data(),
......
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