#pragma once #include #include using namespace std; // Counts number of possible decompositions with 2 primes that sum up to k. int single_goldbach_par(int k); // Counts number of possible decompositions with 2 primes that sum up to k for all even numbers k \in {4,...,n}. vector count_goldbach_par(int n); // Prints all decompositions of k. void print_decomps(int k); /** Vector @p b adds its elements to vector @p a . @param[in] a vector @param[in] b vector @return a+=b componentwise */ template std::vector &operator+=(std::vector &a, std::vector const &b) { assert(a.size()==b.size()); for (size_t k = 0; k < a.size(); ++k) { a[k] += b[k]; } return a; } #pragma omp declare reduction(VecAdd : std::vector : omp_out += omp_in) \ initializer (omp_priv=omp_orig)