diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0fcda3d..57fe101 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -4,8 +4,10 @@ on: push jobs: build: - - runs-on: ubuntu-latest + strategy: + matrix: + os: [ubunt-lastest, macos-14] + runs-on: ${{matrix.os}} container: image: ghcr.io/nnpdf/lhapdf:v2.2.8 # image: ghcr.io/catthehacker/ubuntu:full-latest diff --git a/pywrap/pywrap.cc b/pywrap/pywrap.cc index 39b7885..4ccb0e4 100644 --- a/pywrap/pywrap.cc +++ b/pywrap/pywrap.cc @@ -31,6 +31,16 @@ PYBIND11_MODULE(_core, m) { .def("MuDependentTermsBand", &ApproximateCoefficientFunction::MuDependentTermsBand) .def("fxBand", &ApproximateCoefficientFunction::fxBand); + // ApproximateCoefficientFunctionKLMV + py::class_(m, "ApproximateCoefficientFunctionKLMV") + .def(py::init()) + .def("MuIndependentTerms", &ApproximateCoefficientFunctionKLMV::MuIndependentTerms) + .def("MuDependentTerms", &ApproximateCoefficientFunctionKLMV::MuDependentTerms) + .def("fx", &ApproximateCoefficientFunctionKLMV::fx) + .def("MuIndependentTermsBand", &ApproximateCoefficientFunctionKLMV::MuIndependentTermsBand) + .def("MuDependentTermsBand", &ApproximateCoefficientFunctionKLMV::MuDependentTermsBand) + .def("fxBand", &ApproximateCoefficientFunctionKLMV::fxBand); + // AsymptoticCoefficientFunction py::class_(m, "AsymptoticCoefficientFunction") .def(py::init()) diff --git a/src/ApproximateCoefficientFunctions.cc b/src/ApproximateCoefficientFunctions.cc index 26cd6c0..3bbc12b 100644 --- a/src/ApproximateCoefficientFunctions.cc +++ b/src/ApproximateCoefficientFunctions.cc @@ -28,7 +28,7 @@ double AbstractApproximate::MuIndependentTerms(double x, double m2Q2, int nf) co Value AbstractApproximate::fxBand(double x, double m2Q2, double m2mu2, int nf) const { double x_max = 1. / (1. + 4 * m2Q2); - if (x >= x_max || x < 0) + if (x >= x_max || x <= 0) return 0; return MuIndependentTermsBand(x, m2Q2, nf) + MuDependentTerms(x, m2Q2, m2mu2, nf); @@ -111,7 +111,7 @@ Value ApproximateCoefficientFunction::MuIndependentTermsBand(double x, double m2 double Amax = fact * A, Amin = A / fact, Bmax = B * fact, Bmin = B / fact; double Cmax = (1. + var) * C, Cmin = (1. - var) * C, Dmax = (1. + var) * D, Dmin = (1. - var) * D; - double Avec[3] = { A, Amin, Amax }; + double Avec[3] = { A, Amax, Amin }; double Bvec[3] = { B, Bmax, Bmin }; double Cvec[3] = { C, Cmax, Cmin }; double Dvec[3] = { D, Dmax, Dmin }; diff --git a/src/CoefficientFunction.cc b/src/CoefficientFunction.cc index e82adf9..59a7600 100644 --- a/src/CoefficientFunction.cc +++ b/src/CoefficientFunction.cc @@ -50,21 +50,7 @@ vector Value::ToVect() const { } Value Value::operator+(const Value& rhs) const { - double res_central = central_ + rhs.central_; - double res_higher = res_central, res_lower = res_central; - - double vec_lhs[3] = {central_, higher_, lower_}; - double vec_rhs[3] = {rhs.central_, rhs.higher_, rhs.lower_}; - - double tmp; - for (int i=0; i<3; i++) { - for(int j=0; j<3; j++) { - tmp = vec_lhs[i] + vec_rhs[j]; - if (tmp > res_higher) res_higher = tmp; - if (tmp < res_lower) res_higher = tmp; - } - } - return Value(res_central, res_higher, res_lower); + return Value(central_ + rhs.central_, higher_ + rhs.higher_, lower_ + rhs.lower_); } // Value Value::operator-(const Value& rhs) const {