Skip to content

Commit

Permalink
Call clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
niclaurenti committed Mar 27, 2024
1 parent 2bb072a commit 2eb4cd2
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 42 deletions.
3 changes: 2 additions & 1 deletion inc/adani/ApproximateCoefficientFunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 6 additions & 5 deletions output/output_grid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
21 changes: 11 additions & 10 deletions pywrap/pywrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ PYBIND11_MODULE(_core, m) {
py::init<const double &, const double &, const double &>(),
py::arg("central"), py::arg("higher"), py::arg("lower")
)
.def(py::init<const double &, const double &>(), py::arg("higher"), py::arg("lower"))
.def(
py::init<const double &, const double &>(), py::arg("higher"),
py::arg("lower")
)
.def(py::init<const double &>(), py::arg("central"))
.def(py::self + py::self)
.def(py::self + double())
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -246,8 +249,7 @@ PYBIND11_MODULE(_core, m) {
// HighScaleCoefficientFunction
py::class_<HighScaleCoefficientFunction>(m, "HighScaleCoefficientFunction")
.def(
py::init<
const int &, const char &, const char &, const string &>(),
py::init<const int &, const char &, const char &, const string &>(),
py::arg("order"), py::arg("kind"), py::arg("channel"),
py::arg("version") = "original"
)
Expand All @@ -272,8 +274,7 @@ PYBIND11_MODULE(_core, m) {
// HighScaleSplitLogs
py::class_<HighScaleSplitLogs>(m, "HighScaleSplitLogs")
.def(
py::init<
const int &, const char &, const char &, const string &>(),
py::init<const int &, const char &, const char &, const string &>(),
py::arg("order"), py::arg("kind"), py::arg("channel"),
py::arg("version") = "original"
)
Expand Down
11 changes: 5 additions & 6 deletions src/ApproximateCoefficientFunction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/HighScaleCoefficientFunction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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();
Expand Down
6 changes: 3 additions & 3 deletions src/HighScaleSplitLogs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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();
Expand Down
35 changes: 21 additions & 14 deletions src/MatchingCondition.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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);
}

Expand All @@ -49,7 +51,6 @@ MatchingCondition::MatchingCondition(
}

version_ = version;

}

//==========================================================================================//
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -94,27 +99,29 @@ vector<double> 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 };
}
}

Expand Down

0 comments on commit 2eb4cd2

Please sign in to comment.