Go to the source code of this file.
◆ main()
Definition at line 9 of file test_user_defined_reduction_complex.cpp.
References qmcplusplus::imag(), and qmcplusplus::Units::force::N.
12 std::vector<std::complex<float>> array(
N);
14 auto array_ptr = array.data();
15 for (
int i = 0; i <
N; i++)
16 array_ptr[i] = std::complex<float>(i);
18 std::complex<float> sum;
19 #pragma omp parallel for reduction(+: sum) 20 for (
int i = 0; i <
N; i++)
float imag(const float &c)
imaginary part of a scalar. Cannot be replaced by std::imag due to AFQMC specific needs...