9#include <util/containers/Array.h>
24 for (
int i = 0; i < n; i++) {
28 return std::complex<double>(
sum[0],
sum[1]);
45 for (
int i = begin; i < end; i++) {
49 return std::complex<double>(
sum[0],
sum[1]);
63 for (
int i = 0; i < n; i++) {
66 sum[0] += ar*ar - ai*ai;
67 sum[1] += 2.0 * ar * ai;
69 return std::complex<double>(
sum[0],
sum[1]);
84 for (
int i = 0; i < n; i++) {
85 sum[0] += a[i][0] * b[i][0] - a[i][1] * b[i][1];
86 sum[1] += a[i][0] * b[i][1] + a[i][1] * b[i][0];
88 return std::complex<double>(
sum[0],
sum[1]);
Array container class template.
int capacity() const
Return allocated size.
#define UTIL_CHECK(condition)
Assertion macro suitable for serial or parallel production code.
std::complex< double > sumProduct(Array< fftw_complex > const &a, Array< fftw_complex > const &b)
Compute sum of complex products of elements of two arrays (complex).
double sumSq(Array< double > const &in)
Compute sum of of squares of array elements (real).
double sum(Array< double > const &in)
Compute sum of array elements (real).
Reduction operations performed on a CPU or GPU.
PSCF package top-level namespace.