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 DB_ARGS_SEQ B_ARGS_SEQ
35#define C_ARGS_SEQ (p10_in)(p21_in)(p20_in)(m02_in)(m12_in)(m22_in)
36#define D_ARGS_SEQ \
37 (p10_in)(p21_in)(p32_in)(p30_in)(p20_in)(p31_in)(m02_in)(m12_in)(m22_in)( \
38 m32_in)
39
40#define A_ARGS BOOST_PP_SEQ_FOR_EACH(ARGS_TYPE, , A_ARGS_SEQ) double scl2_in
41#define B_ARGS BOOST_PP_SEQ_FOR_EACH(ARGS_TYPE, , B_ARGS_SEQ) double scl2_in
42#define DB_ARGS B_ARGS
43#define C_ARGS BOOST_PP_SEQ_FOR_EACH(ARGS_TYPE, , C_ARGS_SEQ) double scl2_in
44#define D_ARGS BOOST_PP_SEQ_FOR_EACH(ARGS_TYPE, , D_ARGS_SEQ) double scl2_in
45
46#define A_CSEQ (0)
47#define B_CSEQ (0)(1)(00)
48#define DB_CSEQ (0)(1)(00)
49#define C_CSEQ (0)(1)(2)(00)(11)(12)(22)
50#define D_CSEQ (0)(1)(2)(3)(00)(11)(12)(13)(22)(23)(33)
51
52#define A_N BOOST_PP_SEQ_SIZE(A_CSEQ)
53#define B_N BOOST_PP_SEQ_SIZE(B_CSEQ)
54#define DB_N BOOST_PP_SEQ_SIZE(DB_CSEQ)
55#define C_N BOOST_PP_SEQ_SIZE(C_CSEQ)
56#define D_N BOOST_PP_SEQ_SIZE(D_CSEQ)
57
58#define APPEND(s, data, elem) data##elem
59#define A_SEQ BOOST_PP_SEQ_TRANSFORM(APPEND, A, A_CSEQ)
60#define B_SEQ BOOST_PP_SEQ_TRANSFORM(APPEND, B, B_CSEQ)
61#define DB_SEQ BOOST_PP_SEQ_TRANSFORM(APPEND, DB, DB_CSEQ)
62#define C_SEQ BOOST_PP_SEQ_TRANSFORM(APPEND, C, C_CSEQ)
63#define D_SEQ BOOST_PP_SEQ_TRANSFORM(APPEND, D, D_CSEQ)
64
65namespace flexiblesusy
66{
67namespace looplibrary
68{
69
70using Acoeff_t = std::array<std::complex<double>, A_N>;
71using Bcoeff_t = std::array<std::complex<double>, B_N>;
72using DBcoeff_t = std::array<std::complex<double>, DB_N>;
73using Ccoeff_t = std::array<std::complex<double>, C_N>;
74using Dcoeff_t = std::array<std::complex<double>, D_N>;
75
76constexpr int aa0 = 0;
77
78constexpr int bb0 = 0;
79constexpr int bb1 = 1;
80constexpr int bb00 = 2;
81
82constexpr int cc0 = 0;
83constexpr int cc1 = 1;
84constexpr int cc2 = 2;
85constexpr int cc00 = 3;
86constexpr int cc11 = 4;
87constexpr int cc12 = 5;
88constexpr int cc22 = 6;
89
90constexpr int dd0 = 0;
91constexpr int dd1 = 1;
92constexpr int dd2 = 2;
93constexpr int dd3 = 3;
94constexpr int dd00 = 4;
95constexpr int dd11 = 5;
96constexpr int dd12 = 6;
97constexpr int dd13 = 7;
98constexpr int dd22 = 8;
99constexpr int dd23 = 9;
100constexpr int dd33 = 10;
101
102enum Acoeffs : int {
103 BOOST_PP_SEQ_ENUM(BOOST_PP_SEQ_TRANSFORM(APPEND, a, A_CSEQ))
104};
105enum Bcoeffs : int {
106 BOOST_PP_SEQ_ENUM(BOOST_PP_SEQ_TRANSFORM(APPEND, b, B_CSEQ))
107};
108enum DBcoeffs : int {
109 BOOST_PP_SEQ_ENUM(BOOST_PP_SEQ_TRANSFORM(APPEND, db, DB_CSEQ))
110};
111enum Ccoeffs : int {
112 BOOST_PP_SEQ_ENUM(BOOST_PP_SEQ_TRANSFORM(APPEND, c, C_CSEQ))
113};
114enum Dcoeffs : int {
115 BOOST_PP_SEQ_ENUM(BOOST_PP_SEQ_TRANSFORM(APPEND, d, D_CSEQ))
116};
117
184{
185public:
186 BOOST_PP_SEQ_FOR_EACH(VIRTUAL, (A_ARGS), A_SEQ)
187 BOOST_PP_SEQ_FOR_EACH(VIRTUAL, (B_ARGS), B_SEQ)
188 BOOST_PP_SEQ_FOR_EACH(VIRTUAL, (DB_ARGS), DB_SEQ)
189 BOOST_PP_SEQ_FOR_EACH(VIRTUAL, (C_ARGS), C_SEQ)
190 BOOST_PP_SEQ_FOR_EACH(VIRTUAL, (D_ARGS), D_SEQ)
191 virtual void A(Acoeff_t&, A_ARGS) = 0;
192 virtual void B(Bcoeff_t&, B_ARGS) = 0;
193 virtual void DB(DBcoeff_t&, DB_ARGS) = 0;
194 virtual void C(Ccoeff_t&, C_ARGS) = 0;
195 virtual void D(Dcoeff_t&, D_ARGS) = 0;
197};
198} // namespace looplibrary
199} // namespace flexiblesusy
200
201#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 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 DB(DBcoeff_t &, BOOST_PP_SEQ_FOR_EACH(ARGS_TYPE,,(p10_in)(m02_in)(m12_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 DB_N
#define C_SEQ
#define VIRTUAL(R, ARGS, NAME)
#define B_CSEQ
#define A_N
#define A_ARGS
#define D_N
#define A_SEQ
#define DB_CSEQ
#define DB_ARGS
#define C_N
#define DB_SEQ
#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)(1)(00)) > DBcoeff_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