From 2eb4cd24f1dabc722d16918e0461665a3fb8d0f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niccol=C3=B2=20Laurenti?= Date: Wed, 27 Mar 2024 11:45:24 +0100 Subject: [PATCH] Call clang-format --- inc/adani/ApproximateCoefficientFunction.h | 3 +- output/output_grid.cpp | 11 +++---- pywrap/pywrap.cc | 21 ++++++------- src/ApproximateCoefficientFunction.cc | 11 ++++--- src/HighScaleCoefficientFunction.cc | 6 ++-- src/HighScaleSplitLogs.cc | 6 ++-- src/MatchingCondition.cc | 35 +++++++++++++--------- 7 files changed, 51 insertions(+), 42 deletions(-) diff --git a/inc/adani/ApproximateCoefficientFunction.h b/inc/adani/ApproximateCoefficientFunction.h index 4cf8195..0412cca 100644 --- a/inc/adani/ApproximateCoefficientFunction.h +++ b/inc/adani/ApproximateCoefficientFunction.h @@ -89,7 +89,8 @@ class ApproximateCoefficientFunction : public AbstractApproximate { public: ApproximateCoefficientFunction( const int &order, const char &kind, const char &channel, - const bool &NLL = true, const string &highscale_version = "original", + const bool &NLL = true, + const string &highscale_version = "original", const double &abserr = 1e-3, const double &relerr = 1e-3, const int &dim = 1000, const int &method_flag = 0, const int &MCcalls = 25000 diff --git a/output/output_grid.cpp b/output/output_grid.cpp index 9a49c37..fd182cc 100644 --- a/output/output_grid.cpp +++ b/output/output_grid.cpp @@ -98,12 +98,13 @@ int main(int argc, char **argv) { string hs_version; - if (channel == 'q') hs_version = "exact"; - else hs_version = "improved"; + if (channel == 'q') + hs_version = "exact"; + else + hs_version = "improved"; - ApproximateCoefficientFunction Approx = ApproximateCoefficientFunction( - 3, kind, channel, true, hs_version - ); + ApproximateCoefficientFunction Approx = + ApproximateCoefficientFunction(3, kind, channel, true, hs_version); for (double Q_ : Q) { for (double x_ : x) { diff --git a/pywrap/pywrap.cc b/pywrap/pywrap.cc index 8ff8262..92eb440 100644 --- a/pywrap/pywrap.cc +++ b/pywrap/pywrap.cc @@ -23,7 +23,10 @@ PYBIND11_MODULE(_core, m) { py::init(), py::arg("central"), py::arg("higher"), py::arg("lower") ) - .def(py::init(), py::arg("higher"), py::arg("lower")) + .def( + py::init(), py::arg("higher"), + py::arg("lower") + ) .def(py::init(), py::arg("central")) .def(py::self + py::self) .def(py::self + double()) @@ -45,8 +48,8 @@ PYBIND11_MODULE(_core, m) { .def( py::init< const int &, const char &, const char &, const bool &, - const string &, const double &, const double &, - const int &, const int &, const int &>(), + const string &, const double &, const double &, const int &, + const int &, const int &>(), py::arg("order"), py::arg("kind"), py::arg("channel"), py::arg("NLL") = true, py::arg("highscale_version") = "original", py::arg("abserr") = 1e-3, py::arg("relerr") = 1e-3, @@ -78,9 +81,9 @@ PYBIND11_MODULE(_core, m) { ) .def( py::init< - const int &, const char &, const char &, const string &, const bool &, - const double &, const double &, const int &, const int &, - const int &>(), + const int &, const char &, const char &, const string &, + const bool &, const double &, const double &, const int &, + const int &, const int &>(), py::arg("order"), py::arg("kind"), py::arg("channel"), py::arg("highscale_version") = "original", py::arg("lowxi") = false, py::arg("abserr") = 1e-3, py::arg("relerr") = 1e-3, @@ -246,8 +249,7 @@ PYBIND11_MODULE(_core, m) { // HighScaleCoefficientFunction py::class_(m, "HighScaleCoefficientFunction") .def( - py::init< - const int &, const char &, const char &, const string &>(), + py::init(), py::arg("order"), py::arg("kind"), py::arg("channel"), py::arg("version") = "original" ) @@ -272,8 +274,7 @@ PYBIND11_MODULE(_core, m) { // HighScaleSplitLogs py::class_(m, "HighScaleSplitLogs") .def( - py::init< - const int &, const char &, const char &, const string &>(), + py::init(), py::arg("order"), py::arg("kind"), py::arg("channel"), py::arg("version") = "original" ) diff --git a/src/ApproximateCoefficientFunction.cc b/src/ApproximateCoefficientFunction.cc index 2348064..e619cd1 100644 --- a/src/ApproximateCoefficientFunction.cc +++ b/src/ApproximateCoefficientFunction.cc @@ -94,9 +94,8 @@ struct variation_parameters CL_var = { 0.2, 2. }; ApproximateCoefficientFunction::ApproximateCoefficientFunction( const int &order, const char &kind, const char &channel, const bool &NLL, - const string &highscale_version, - const double &abserr, const double &relerr, const int &dim, - const int &method_flag, const int &MCcalls + const string &highscale_version, const double &abserr, const double &relerr, + const int &dim, const int &method_flag, const int &MCcalls ) : AbstractApproximate( order, kind, channel, abserr, relerr, dim, method_flag, MCcalls @@ -261,9 +260,9 @@ struct klmv_params klmv_C2g3B_lowxi = { 0.8, 10.7, 0.055125, 2, 0.3825 }; ApproximateCoefficientFunctionKLMV::ApproximateCoefficientFunctionKLMV( const int &order, const char &kind, const char &channel, - const string &highscale_version, const bool &lowxi, - const double &abserr, const double &relerr, const int &dim, - const int &method_flag, const int &MCcalls + const string &highscale_version, const bool &lowxi, const double &abserr, + const double &relerr, const int &dim, const int &method_flag, + const int &MCcalls ) : AbstractApproximate( order, kind, channel, abserr, relerr, dim, method_flag, MCcalls diff --git a/src/HighScaleCoefficientFunction.cc b/src/HighScaleCoefficientFunction.cc index 9369451..1d15503 100644 --- a/src/HighScaleCoefficientFunction.cc +++ b/src/HighScaleCoefficientFunction.cc @@ -13,7 +13,8 @@ using std::endl; //------------------------------------------------------------------------------------------// HighScaleCoefficientFunction::HighScaleCoefficientFunction( - const int &order, const char &kind, const char &channel, const string &version + const int &order, const char &kind, const char &channel, + const string &version ) : CoefficientFunction(order, kind, channel) { massless_as1_ = nullptr; @@ -33,8 +34,7 @@ HighScaleCoefficientFunction::HighScaleCoefficientFunction( new MasslessCoefficientFunction(3, GetKind(), GetChannel()); if (GetOrder() == 3 && GetKind() == '2') { - a_muindep_ = - new MatchingCondition(3, 'Q', GetChannel(), version); + a_muindep_ = new MatchingCondition(3, 'Q', GetChannel(), version); } SetFunctions(); diff --git a/src/HighScaleSplitLogs.cc b/src/HighScaleSplitLogs.cc index 3df607d..d74d986 100644 --- a/src/HighScaleSplitLogs.cc +++ b/src/HighScaleSplitLogs.cc @@ -13,7 +13,8 @@ using std::endl; //------------------------------------------------------------------------------------------// HighScaleSplitLogs::HighScaleSplitLogs( - const int &order, const char &kind, const char &channel, const string &version + const int &order, const char &kind, const char &channel, + const string &version ) : CoefficientFunction(order, kind, channel) { if (order != 3) { @@ -34,8 +35,7 @@ HighScaleSplitLogs::HighScaleSplitLogs( new MasslessCoefficientFunction(GetOrder(), GetKind(), GetChannel()); if (GetOrder() == 3 && GetKind() == '2') { - a_muindep_ = - new MatchingCondition(3, 'Q', GetChannel(), version); + a_muindep_ = new MatchingCondition(3, 'Q', GetChannel(), version); } SetFunctions(); diff --git a/src/MatchingCondition.cc b/src/MatchingCondition.cc index 6a128a9..1b3c139 100644 --- a/src/MatchingCondition.cc +++ b/src/MatchingCondition.cc @@ -13,7 +13,8 @@ using std::endl; //------------------------------------------------------------------------------------------// MatchingCondition::MatchingCondition( - const int &order, const char &entry1, const char &entry2, const string &version + const int &order, const char &entry1, const char &entry2, + const string &version ) { // check order if (order != 3) { @@ -37,9 +38,10 @@ MatchingCondition::MatchingCondition( } entry2_ = entry2; - //check version + // check version if (version != "exact" && version != "improved" && version != "original") { - cout << "Error: version must be 'exact', 'improved' or 'original'! Got " << version << endl; + cout << "Error: version must be 'exact', 'improved' or 'original'! Got " + << version << endl; exit(-1); } @@ -49,7 +51,6 @@ MatchingCondition::MatchingCondition( } version_ = version; - } //==========================================================================================// @@ -60,7 +61,8 @@ MatchingCondition::MatchingCondition( Value MatchingCondition::MuIndependentNfIndependentTerm(double x) const { double central, higher, lower; if (entry2_ == 'q') { - if (version_ == "exact") return Value(a_Qq_PS_30(x, 0)); + if (version_ == "exact") + return Value(a_Qq_PS_30(x, 0)); else { higher = a_Qq_PS_30(x, 1); lower = a_Qq_PS_30(x, -1); @@ -71,9 +73,12 @@ Value MatchingCondition::MuIndependentNfIndependentTerm(double x) const { } } else { int low_id; - if (version_ == "exact") return Value(a_Qg_30(x, 0)); - else if (version_ == "improved") low_id = -1; - else low_id = -12; + if (version_ == "exact") + return Value(a_Qg_30(x, 0)); + else if (version_ == "improved") + low_id = -1; + else + low_id = -12; higher = a_Qg_30(x, 1); lower = a_Qg_30(x, low_id); @@ -94,27 +99,29 @@ vector MatchingCondition::NotOrdered(double x) const { if (entry2_ == 'q') { if (version_ == "exact") { central = a_Qq_PS_30(x, 0); - return {central, central, central}; + return { central, central, central }; } else { higher = a_Qq_PS_30(x, 1); lower = a_Qq_PS_30(x, -1); central = 0.5 * (higher + lower); - return {central, higher, lower}; + return { central, higher, lower }; } } else { int low_id; if (version_ == "exact") { central = a_Qg_30(x, 0); - return {central, central, central}; - } else if (version_ == "improved") low_id = -1; - else low_id = -12; + return { central, central, central }; + } else if (version_ == "improved") + low_id = -1; + else + low_id = -12; higher = a_Qg_30(x, 1); lower = a_Qg_30(x, low_id); central = 0.5 * (higher + lower); - return {central, higher, lower}; + return { central, higher, lower }; } }