flexiblesusy is hosted by Hepforge, IPPP Durham
FlexibleSUSY
library_looptools.cpp
Go to the documentation of this file.
1// ====================================================================
2// This file is part of FlexibleSUSY.
3//
4// FlexibleSUSY is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published
6// by the Free Software Foundation, either version 3 of the License,
7// or (at your option) any later version.
8//
9// FlexibleSUSY is distributed in the hope that it will be useful, but
10// WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12// General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with FlexibleSUSY. If not, see
16// <http://www.gnu.org/licenses/>.
17// ====================================================================
18
19#include "library_looptools.hpp"
20#include "clooptools.h"
21#include "fortran_utils.hpp"
22#include <boost/preprocessor/seq/elem.hpp>
23#include <boost/preprocessor/seq/for_each_i.hpp>
24#include <limits>
25
26#define A_PAIR (A)(aa)
27#define B_PAIR (B)(bb)
28#define C_PAIR (C)(cc)
29#define D_PAIR (D)(dd)
30
31#define REAL(R, DUMMY, ELEM) , ELEM.real()
32
33#define CAT_(a, b) a##b
34#define CAT(a, b) CAT_(a, b)
35
36#define LIB(PAIR) BOOST_PP_SEQ_ELEM(0, PAIR)
37#define LT(PAIR) BOOST_PP_SEQ_ELEM(1, PAIR)
38
39#define LIB_NAME(PAIR, INDEX) CAT(LIB(PAIR), INDEX)
40#define LIB_ARGS(PAIR) CAT(LIB(PAIR), _ARGS)
41
42#define LT_ARGS(PAIR) CAT(LIB(PAIR), _ARGS_SEQ)
43#define LT_NAME(PAIR) CAT(LIB(PAIR), 0i)
44#define LT_IDX(PAIR, INDEX) CAT(LT(PAIR), INDEX)
45
46#define LT_ONE(_, PAIR, I, INDEX) \
47 std::complex<double> Looptools::LIB_NAME(PAIR, \
48 INDEX)(LIB_ARGS(PAIR)) noexcept \
49 { \
50 set_mu2_uv(scl2_in); \
51 return LT_NAME(PAIR)(LT_IDX(PAIR, INDEX) \
52 BOOST_PP_SEQ_FOR_EACH(REAL, , LT_ARGS(PAIR))); \
53 }
54
55#define LT_ALL(PAIR) \
56 void Looptools::LIB(PAIR)(CAT(LIB(PAIR), coeff_t) & \
57 arr, \
58 CAT(LIB(PAIR), _ARGS)) noexcept \
59 { \
60 const int coeffs[] = {BOOST_PP_SEQ_ENUM( \
61 BOOST_PP_SEQ_TRANSFORM(APPEND, LT(PAIR), CAT(LIB(PAIR), _CSEQ)))}; \
62 ComplexType res[CAT(N, LT(PAIR))]; \
63 set_mu2_uv(scl2_in); \
64 \
65 CAT(LIB(PAIR), put) \
66 (res BOOST_PP_SEQ_FOR_EACH(REAL, , CAT(LIB(PAIR), _ARGS_SEQ))); \
67 for (int i = 0; i < CAT(LIB(PAIR), _N); ++i) { \
68 arr.at(i) = res[coeffs[i]]; \
69 } \
70 }
71
72namespace flexiblesusy
73{
74namespace looplibrary
75{
76
77Looptools::Looptools() : current_mu2_uv(1.0)
78{
80 ltini();
83}
84
85void Looptools::set_mu2_uv(double scl2_in) noexcept
86{
87 if (std::abs(scl2_in - this->current_mu2_uv) >
89 setmudim(scl2_in);
90 this->current_mu2_uv = scl2_in;
91 }
92}
93
94BOOST_PP_SEQ_FOR_EACH_I(LT_ONE, A_PAIR, A_CSEQ)
95BOOST_PP_SEQ_FOR_EACH_I(LT_ONE, B_PAIR, B_CSEQ)
96BOOST_PP_SEQ_FOR_EACH_I(LT_ONE, C_PAIR, C_CSEQ)
97BOOST_PP_SEQ_FOR_EACH_I(LT_ONE, D_PAIR, D_CSEQ)
98
103
104} // namespace looplibrary
105} // namespace flexiblesusy
#define D_PAIR
#define C_PAIR
#define LT_ONE(_, PAIR, I, INDEX)
#define A_PAIR
#define LT_ALL(PAIR)
#define B_PAIR
#define D_CSEQ
#define A_CSEQ
#define B_CSEQ
#define C_CSEQ
void flush() noexcept
Flushes output of fortran routines.
void swap() noexcept
Swaps stdout and stderr descriptors.
const Real epsilon
Definition: mathdefs.hpp:18