diff --git a/output/output_grid.cpp b/output/output_grid.cpp index f263db3..7da9fda 100644 --- a/output/output_grid.cpp +++ b/output/output_grid.cpp @@ -15,7 +15,7 @@ using namespace std; std::string print_time(time_t seconds); -void loopFunction(int start, int end, vector& xvec, vector& Qvec, ApproximateCoefficientFunction* app, double **res_c, double **res_h, double **res_l, double m, int nf, double mufrac); +void loopFunction(int start, int end, vector& xvec, vector& Qvec, ApproximateCoefficientFunction& app, double **res_c, double **res_h, double **res_l, double m, int nf, double mufrac); int main(int argc, char **argv) { @@ -160,7 +160,7 @@ int main(int argc, char **argv) { ApproximateCoefficientFunction Approx = ApproximateCoefficientFunction(3, kind, channel, true, hs_version); - const int iterationsPerThread = rows / numThreads; + int iterationsPerThread = rows / numThreads; std::vector threads; @@ -169,7 +169,7 @@ int main(int argc, char **argv) { for (int i = 0; i < numThreads; ++i) { int start = i * iterationsPerThread; int end = (i == numThreads - 1) ? rows : (i + 1) * iterationsPerThread; - threads.emplace_back(loopFunction, start, end, ref(x), ref(Q), &Approx, res_c, res_h, res_l, m, nf, mufrac); + threads.emplace_back(loopFunction, start, end, ref(x), ref(Q), ref(Approx), res_c, res_h, res_l, m, nf, mufrac); } for (std::thread& thread : threads) { @@ -213,8 +213,8 @@ int main(int argc, char **argv) { cout << "Saving lower grid in " << filename + "_lower.dat" << endl; } - for (int i = 0; i < rows; i++) { - for (int j = 0; j < cols; j++) { + for (int j = 0; j < cols; j++) { + for (int i = 0; i < rows; i++) { output_c << res_c[i][j] << " "; output_h << res_h[i][j] << " "; output_l << res_l[i][j] << " "; @@ -247,7 +247,7 @@ std::string print_time(time_t seconds) { return ss.str(); } -void loopFunction(int start, int end, vector& xvec, vector& Qvec, ApproximateCoefficientFunction* app, double **res_c, double **res_h, double **res_l, double m, int nf, double mufrac) { +void loopFunction(int start, int end, vector& xvec, vector& Qvec, ApproximateCoefficientFunction& app, double **res_c, double **res_h, double **res_l, double m, int nf, double mufrac) { double x, Q, m2Q2, mu, m2mu2; for (int i = start; i < end; i++) { for (int j = 0; j < int(Qvec.size()); j++) { @@ -256,10 +256,11 @@ void loopFunction(int start, int end, vector& xvec, vector& Qvec mu = mufrac * Q; m2Q2 = m * m / (Q * Q); m2mu2 = m * m / (mu * mu); - Value res = app -> fxBand(x, m2Q2, m2mu2, nf); + Value res = app.fxBand(x, m2Q2, m2mu2, nf); res_c[i][j] = res.GetCentral(); res_h[i][j] = res.GetHigher(); res_l[i][j] = res.GetLower(); + // std::cout << "Thread ID: " << std::this_thread::get_id() <<" x="<< x << " Q=" << Q << " mu=" << mu << " nf" << nf << " res_c=" << res_c[i][j] << endl; } } } diff --git a/src/ExactCoefficientFunction.cc b/src/ExactCoefficientFunction.cc index 3a6a81e..9a056e8 100644 --- a/src/ExactCoefficientFunction.cc +++ b/src/ExactCoefficientFunction.cc @@ -286,9 +286,8 @@ double //==========================================================================================// // OBSERVATION: in the O(as^2) exact coefficeint functions the // mu-independent part is an interpolation in a certain grid. When this -// function is called for a (x,Q) value outside this grid, the value 0 is -// returned. The mu-dependent part is defined everywhere. This means that -// outside the grid one contribution is set to zero while the other is not. +// function is called for a (x,Q) value outside this grid, te returned value is the +// appropriate limit. //------------------------------------------------------------------------------------------// /// @cond UNNECESSARY