flexiblesusy is hosted by Hepforge, IPPP Durham
FlexibleSUSY
loop_library_interface.hpp
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#ifndef LOOP_LIBRARY_INTERFACE_H
20#define LOOP_LIBRARY_INTERFACE_H
21
22#include <boost/preprocessor/seq/enum.hpp>
23#include <boost/preprocessor/seq/for_each.hpp>
24#include <boost/preprocessor/seq/size.hpp>
25#include <boost/preprocessor/seq/transform.hpp>
26#include <array>
27#include <complex>
28
29#define ARGS_TYPE(R, COMMA, ELEM) std::complex<double> ELEM,
30#define VIRTUAL(R, ARGS, NAME) virtual std::complex<double> NAME ARGS = 0;
31
32#define A_ARGS_SEQ (m02_in)
33#define B_ARGS_SEQ (p10_in)(m02_in)(m12_in)
34#define C_ARGS_SEQ (p10_in)(p21_in)(p20_in)(m02_in)(m12_in)(m22_in)
35#define D_ARGS_SEQ \
36 (p10_in)(p21_in)(p32_in)(p30_in)(p20_in)(p31_in)(m02_in)(m12_in)(m22_in)( \
37 m32_in)
38
39#define A_ARGS BOOST_PP_SEQ_FOR_EACH(ARGS_TYPE, , A_ARGS_SEQ) double scl2_in
40#define B_ARGS BOOST_PP_SEQ_FOR_EACH(ARGS_TYPE, , B_ARGS_SEQ) double scl2_in
41#define C_ARGS BOOST_PP_SEQ_FOR_EACH(ARGS_TYPE, , C_ARGS_SEQ) double scl2_in
42#define D_ARGS BOOST_PP_SEQ_FOR_EACH(ARGS_TYPE, , D_ARGS_SEQ) double scl2_in
43
44#define A_CSEQ (0)
45#define B_CSEQ (0)(1)(00)
46#define C_CSEQ (0)(1)(2)(00)(11)(12)(22)
47#define D_CSEQ (0)(1)(2)(3)(00)(11)(12)(13)(22)(23)(33)
48
49#define A_N BOOST_PP_SEQ_SIZE(A_CSEQ)
50#define B_N BOOST_PP_SEQ_SIZE(B_CSEQ)
51#define C_N BOOST_PP_SEQ_SIZE(C_CSEQ)
52#define D_N BOOST_PP_SEQ_SIZE(D_CSEQ)
53
54#define APPEND(s, data, elem) data##elem
55#define A_SEQ BOOST_PP_SEQ_TRANSFORM(APPEND, A, A_CSEQ)
56#define B_SEQ BOOST_PP_SEQ_TRANSFORM(APPEND, B, B_CSEQ)
57#define C_SEQ BOOST_PP_SEQ_TRANSFORM(APPEND, C, C_CSEQ)
58#define D_SEQ BOOST_PP_SEQ_TRANSFORM(APPEND, D, D_CSEQ)
59
60namespace flexiblesusy
61{
62namespace looplibrary
63{
64
65using Acoeff_t = std::array<std::complex<double>, A_N>;
66using Bcoeff_t = std::array<std::complex<double>, B_N>;
67using Ccoeff_t = std::array<std::complex<double>, C_N>;
68using Dcoeff_t = std::array<std::complex<double>, D_N>;
69
70constexpr int aa0 = 0;
71
72constexpr int bb0 = 0;
73constexpr int bb1 = 1;
74constexpr int bb00 = 2;
75
76constexpr int cc0 = 0;
77constexpr int cc1 = 1;
78constexpr int cc2 = 2;
79constexpr int cc00 = 3;
80constexpr int cc11 = 4;
81constexpr int cc12 = 5;
82constexpr int cc22 = 6;
83
84constexpr int dd0 = 0;
85constexpr int dd1 = 1;
86constexpr int dd2 = 2;
87constexpr int dd3 = 3;
88constexpr int dd00 = 4;
89constexpr int dd11 = 5;
90constexpr int dd12 = 6;
91constexpr int dd13 = 7;
92constexpr int dd22 = 8;
93constexpr int dd23 = 9;
94constexpr int dd33 = 10;
95
96enum Acoeffs : int {
97 BOOST_PP_SEQ_ENUM(BOOST_PP_SEQ_TRANSFORM(APPEND, a, A_CSEQ))
98};
99enum Bcoeffs : int {
100 BOOST_PP_SEQ_ENUM(BOOST_PP_SEQ_TRANSFORM(APPEND, b, B_CSEQ))
101};
102enum Ccoeffs : int {
103 BOOST_PP_SEQ_ENUM(BOOST_PP_SEQ_TRANSFORM(APPEND, c, C_CSEQ))
104};
105enum Dcoeffs : int {
106 BOOST_PP_SEQ_ENUM(BOOST_PP_SEQ_TRANSFORM(APPEND, d, D_CSEQ))
107};
108
175{
176public:
177 BOOST_PP_SEQ_FOR_EACH(VIRTUAL, (A_ARGS), A_SEQ)
178 BOOST_PP_SEQ_FOR_EACH(VIRTUAL, (B_ARGS), B_SEQ)
179 BOOST_PP_SEQ_FOR_EACH(VIRTUAL, (C_ARGS), C_SEQ)
180 BOOST_PP_SEQ_FOR_EACH(VIRTUAL, (D_ARGS), D_SEQ)
181 virtual void A(Acoeff_t&, A_ARGS) = 0;
182 virtual void B(Bcoeff_t&, B_ARGS) = 0;
183 virtual void C(Ccoeff_t&, C_ARGS) = 0;
184 virtual void D(Dcoeff_t&, D_ARGS) = 0;
186};
187} // namespace looplibrary
188} // namespace flexiblesusy
189
190#endif // LOOP_LIBRARY_INTERFACE_H
interface for different one loop function libraries with conventions of DE == [arXiv:0709....
virtual void A(Acoeff_t &, BOOST_PP_SEQ_FOR_EACH(ARGS_TYPE,,(m02_in)) double scl2_in)=0
virtual void B(Bcoeff_t &, BOOST_PP_SEQ_FOR_EACH(ARGS_TYPE,,(p10_in)(m02_in)(m12_in)) double scl2_in)=0
virtual void D(Dcoeff_t &, BOOST_PP_SEQ_FOR_EACH(ARGS_TYPE,,(p10_in)(p21_in)(p32_in)(p30_in)(p20_in)(p31_in)(m02_in)(m12_in)(m22_in)(m32_in)) double scl2_in)=0
virtual void C(Ccoeff_t &, BOOST_PP_SEQ_FOR_EACH(ARGS_TYPE,,(p10_in)(p21_in)(p20_in)(m02_in)(m12_in)(m22_in)) double scl2_in)=0
#define B_ARGS
#define B_N
#define D_CSEQ
#define A_CSEQ
#define C_ARGS
#define D_ARGS
#define D_SEQ
#define B_SEQ
#define C_SEQ
#define VIRTUAL(R, ARGS, NAME)
#define B_CSEQ
#define A_N
#define A_ARGS
#define D_N
#define A_SEQ
#define C_N
#define APPEND(s, data, elem)
#define C_CSEQ
std::array< std::complex< double >, BOOST_PP_SEQ_SIZE((0)(1)(2)(00)(11)(12)(22)) > Ccoeff_t
std::array< std::complex< double >, BOOST_PP_SEQ_SIZE((0)) > Acoeff_t
std::array< std::complex< double >, BOOST_PP_SEQ_SIZE((0)(1)(2)(3)(00)(11)(12)(13)(22)(23)(33)) > Dcoeff_t
std::array< std::complex< double >, BOOST_PP_SEQ_SIZE((0)(1)(00)) > Bcoeff_t