Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-08-06 09:24:07

0001 /* -*- C++ -*-
0002    clooptools.h
0003    the C/C++ header file with all definitions for LoopTools
0004    this file is part of LoopTools
0005    last modified 2 Sep 14 th
0006    dgrell 2011-01-21 for Herwig: moved definitions and extern declarations to our clooptools.cc
0007    dgrell 2016-09-08 for Herwig: update to Looptols-2.13
0008 */
0009 
0010 
0011 #ifndef HERWIG_clooptools_h_
0012 #define HERWIG_clooptools_h_
0013 
0014 #include <complex>
0015 
0016 /****************************************************************/
0017 
0018 // Adapted version of ftypes.h
0019 
0020 
0021 typedef double RealType;
0022 typedef double REAL;
0023 
0024 typedef int INTEGER;
0025 typedef const REAL CREAL;
0026 
0027 struct COMPLEX { REAL re, im; };
0028 typedef const COMPLEX CCOMPLEX;
0029 
0030 typedef std::complex<RealType> ComplexType;
0031 
0032 typedef const RealType cRealType;
0033 typedef const ComplexType cComplexType;
0034 
0035 //#define cachelookup_ ljcachelookup_
0036 
0037 // typedef const COMPLEX CCOMPLEX;
0038 
0039 typedef long long int memindex;
0040 
0041 /****************************************************************/
0042 
0043 #define AARGS(t) t(m)
0044 
0045 #define BARGS(t) t(p), t(m1), t(m2)
0046 
0047 #define CARGS(t) t(p1), t(p2), t(p1p2), t(m1), t(m2), t(m3)
0048 
0049 #define DARGS(t) t(p1), t(p2), t(p3), t(p4), t(p1p2), t(p2p3),  \
0050     t(m1), t(m2), t(m3), t(m4)
0051 
0052 #define EARGS(t) t(p1), t(p2), t(p3), t(p4), t(p5), \
0053     t(p1p2), t(p2p3), t(p3p4), t(p4p5), t(p5p1),    \
0054     t(m1), t(m2), t(m3), t(m4), t(m5)
0055 
0056 /****************************************************************/
0057 
0058 #define _lt_Cr_(v) cRealType v
0059 #define _lt_Cc_(v) cComplexType v
0060 #define _lt_Fr_(v) CREAL *v
0061 #define _lt_Fc_(v) CCOMPLEX *v
0062 #define _lt_Id_(v) v
0063 #define _lt_Frp_(v) &v
0064 #define _lt_Fcp_(v) (CCOMPLEX *)&v
0065 #define _lt_Fap_(v) (COMPLEX *)v
0066 
0067 // #define _lt_Frd_(f)
0068 // #define _lt_Fcd_(f)
0069 // #define _lt_Fad_(v,n)
0070 // #define _lt_Fax_(v,n)
0071 
0072 /****************************************************************/
0073 
0074 namespace Herwig {
0075   namespace Looptools {
0076 
0077     enum {
0078       aa0 = 0, 
0079       aa00 = 3, 
0080       Naa = 6
0081     };
0082 
0083     enum {
0084       bb0 = 0,
0085       bb1 = 3,
0086       bb00 = 6,
0087       bb11 = 9,
0088       bb001 = 12,
0089       bb111 = 15,
0090       dbb0 = 18,
0091       dbb1 = 21,
0092       dbb00 = 24,
0093       dbb11 = 27,
0094       dbb001 = 30,
0095       Nbb = 33
0096     };
0097 
0098     enum {
0099       cc0 = 0,
0100       cc1 = 3,
0101       cc2 = 6,
0102       cc00 = 9,
0103       cc11 = 12,
0104       cc12 = 15,
0105       cc22 = 18,
0106       cc001 = 21,
0107       cc002 = 24,
0108       cc111 = 27,
0109       cc112 = 30,
0110       cc122 = 33,
0111       cc222 = 36,
0112       cc0000 = 39,
0113       cc0011 = 42,
0114       cc0012 = 45,
0115       cc0022 = 48,
0116       cc1111 = 51,
0117       cc1112 = 54,
0118       cc1122 = 57,
0119       cc1222 = 60,
0120       cc2222 = 63,
0121       Ncc = 66
0122     };
0123 
0124     enum {
0125       dd0 = 0,
0126       dd1 = 3,
0127       dd2 = 6,
0128       dd3 = 9,
0129       dd00 = 12,
0130       dd11 = 15,
0131       dd12 = 18,
0132       dd13 = 21,
0133       dd22 = 24,
0134       dd23 = 27,
0135       dd33 = 30,
0136       dd001 = 33,
0137       dd002 = 36,
0138       dd003 = 39,
0139       dd111 = 42,
0140       dd112 = 45,
0141       dd113 = 48,
0142       dd122 = 51,
0143       dd123 = 54,
0144       dd133 = 57,
0145       dd222 = 60,
0146       dd223 = 63,
0147       dd233 = 66,
0148       dd333 = 69,
0149       dd0000 = 72,
0150       dd0011 = 75,
0151       dd0012 = 78,
0152       dd0013 = 81,
0153       dd0022 = 84,
0154       dd0023 = 87,
0155       dd0033 = 90,
0156       dd1111 = 93,
0157       dd1112 = 96,
0158       dd1113 = 99,
0159       dd1122 = 102,
0160       dd1123 = 105,
0161       dd1133 = 108,
0162       dd1222 = 111,
0163       dd1223 = 114,
0164       dd1233 = 117,
0165       dd1333 = 120,
0166       dd2222 = 123,
0167       dd2223 = 126,
0168       dd2233 = 129,
0169       dd2333 = 132,
0170       dd3333 = 135,
0171       dd00001 = 138,
0172       dd00002 = 141,
0173       dd00003 = 144,
0174       dd00111 = 147,
0175       dd00112 = 150,
0176       dd00113 = 153,
0177       dd00122 = 156,
0178       dd00123 = 159,
0179       dd00133 = 162,
0180       dd00222 = 165,
0181       dd00223 = 168,
0182       dd00233 = 171,
0183       dd00333 = 174,
0184       dd11111 = 177,
0185       dd11112 = 180,
0186       dd11113 = 183,
0187       dd11122 = 186,
0188       dd11123 = 189,
0189       dd11133 = 192,
0190       dd11222 = 195,
0191       dd11223 = 198,
0192       dd11233 = 201,
0193       dd11333 = 204,
0194       dd12222 = 207,
0195       dd12223 = 210,
0196       dd12233 = 213,
0197       dd12333 = 216,
0198       dd13333 = 219,
0199       dd22222 = 222,
0200       dd22223 = 225,
0201       dd22233 = 228,
0202       dd22333 = 231,
0203       dd23333 = 234,
0204       dd33333 = 237,
0205       Ndd = 240
0206     };
0207 
0208     enum {
0209       ee0 = 0,
0210       ee1 = 3,
0211       ee2 = 6,
0212       ee3 = 9,
0213       ee4 = 12,
0214       ee00 = 15,
0215       ee11 = 18,
0216       ee12 = 21,
0217       ee13 = 24,
0218       ee14 = 27,
0219       ee22 = 30,
0220       ee23 = 33,
0221       ee24 = 36,
0222       ee33 = 39,
0223       ee34 = 42,
0224       ee44 = 45,
0225       ee001 = 48,
0226       ee002 = 51,
0227       ee003 = 54,
0228       ee004 = 57,
0229       ee111 = 60,
0230       ee112 = 63,
0231       ee113 = 66,
0232       ee114 = 69,
0233       ee122 = 72,
0234       ee123 = 75,
0235       ee124 = 78,
0236       ee133 = 81,
0237       ee134 = 84,
0238       ee144 = 87,
0239       ee222 = 90,
0240       ee223 = 93,
0241       ee224 = 96,
0242       ee233 = 99,
0243       ee234 = 102,
0244       ee244 = 105,
0245       ee333 = 108,
0246       ee334 = 111,
0247       ee344 = 114,
0248       ee444 = 117,
0249       ee0000 = 120,
0250       ee0011 = 123,
0251       ee0012 = 126,
0252       ee0013 = 129,
0253       ee0014 = 132,
0254       ee0022 = 135,
0255       ee0023 = 138,
0256       ee0024 = 141,
0257       ee0033 = 144,
0258       ee0034 = 147,
0259       ee0044 = 150,
0260       ee1111 = 153,
0261       ee1112 = 156,
0262       ee1113 = 159,
0263       ee1114 = 162,
0264       ee1122 = 165,
0265       ee1123 = 168,
0266       ee1124 = 171,
0267       ee1133 = 174,
0268       ee1134 = 177,
0269       ee1144 = 180,
0270       ee1222 = 183,
0271       ee1223 = 186,
0272       ee1224 = 189,
0273       ee1233 = 192,
0274       ee1234 = 195,
0275       ee1244 = 198,
0276       ee1333 = 201,
0277       ee1334 = 204,
0278       ee1344 = 207,
0279       ee1444 = 210,
0280       ee2222 = 213,
0281       ee2223 = 216,
0282       ee2224 = 219,
0283       ee2233 = 222,
0284       ee2234 = 225,
0285       ee2244 = 228,
0286       ee2333 = 231,
0287       ee2334 = 234,
0288       ee2344 = 237,
0289       ee2444 = 240,
0290       ee3333 = 243,
0291       ee3334 = 246,
0292       ee3344 = 249,
0293       ee3444 = 252,
0294       ee4444 = 255,
0295       Nee = 258
0296     };
0297 
0298     enum {
0299       KeyA0 = 1,
0300       KeyBget = 1<<2,
0301       KeyC0 = 1<<4,
0302       KeyD0 = 1<<6,
0303       KeyE0 = 1<<8,
0304       KeyEget = 1<<10,
0305       KeyEgetC = 1<<12,
0306       KeyAll = KeyA0 + KeyBget + KeyC0 + KeyD0 + KeyE0 + KeyEget + KeyEgetC
0307     };
0308 
0309     enum {
0310       DebugA = 1,
0311       DebugB = 1<<1,
0312       DebugC = 1<<2,
0313       DebugD = 1<<3,
0314       DebugE = 1<<4,
0315       DebugAll = DebugA + DebugB + DebugC + DebugD + DebugE
0316     };
0317 
0318     ComplexType ToComplex(COMPLEX c);
0319 
0320     /**
0321      *  Looptools initialisation
0322      */
0323     void ltini(std::string logfilename = std::string("Looptools.log"));
0324 
0325     /**
0326      *  Looptools termination
0327      */
0328     void ltexi(std::string logfilename = std::string("Looptools.log"));
0329 
0330     /****************************************************************/
0331 
0332     memindex Aget(AARGS(_lt_Cr_));
0333     memindex AgetC(AARGS(_lt_Cc_));
0334 
0335     void Aput(ComplexType *res, AARGS(_lt_Cr_));
0336     void AputC(ComplexType *res, AARGS(_lt_Cc_));
0337 
0338     void Aputnocache(ComplexType *res, AARGS(_lt_Cr_));
0339     void AputnocacheC(ComplexType *res, AARGS(_lt_Cc_));
0340 
0341     COMPLEX *Acache(const memindex integral);
0342     COMPLEX *AcacheC(const memindex integral);
0343 
0344     ComplexType Aval(const int i, const memindex integral);
0345     ComplexType AvalC(const int i, const memindex integral);
0346 
0347     ComplexType A0i(const int i, AARGS(_lt_Cr_));
0348     ComplexType A0iC(const int i, AARGS(_lt_Cc_));
0349 
0350     ComplexType A0(AARGS(_lt_Cr_));
0351     ComplexType A00(AARGS(_lt_Cr_));
0352 
0353     ComplexType A0C(AARGS(_lt_Cc_));
0354     ComplexType A00C(AARGS(_lt_Cc_));
0355 
0356     /****************************************************************/
0357 
0358     memindex Bget(BARGS(_lt_Cr_));
0359     memindex BgetC(BARGS(_lt_Cc_));
0360 
0361     void Bput(ComplexType *res, BARGS(_lt_Cr_));
0362     void BputC(ComplexType *res, BARGS(_lt_Cc_));
0363 
0364     void Bputnocache(ComplexType *res, BARGS(_lt_Cr_));
0365     void BputnocacheC(ComplexType *res, BARGS(_lt_Cc_));
0366 
0367     COMPLEX *Bcache(const memindex integral);
0368     COMPLEX *BcacheC(const memindex integral);
0369 
0370     ComplexType Bval(const int i, const memindex integral);
0371     ComplexType BvalC(const int i, const memindex integral);
0372 
0373     ComplexType B0i(const int i, BARGS(_lt_Cr_));
0374     ComplexType B0iC(const int i, BARGS(_lt_Cc_));
0375 
0376     ComplexType B0(BARGS(_lt_Cr_));
0377     ComplexType B1(BARGS(_lt_Cr_));
0378     ComplexType B00(BARGS(_lt_Cr_));
0379     ComplexType B11(BARGS(_lt_Cr_));
0380     ComplexType B001(BARGS(_lt_Cr_));
0381     ComplexType B111(BARGS(_lt_Cr_));
0382     ComplexType DB0(BARGS(_lt_Cr_));
0383     ComplexType DB1(BARGS(_lt_Cr_));
0384     ComplexType DB00(BARGS(_lt_Cr_));
0385     ComplexType DB11(BARGS(_lt_Cr_));
0386 
0387     ComplexType B0C(BARGS(_lt_Cc_));
0388     ComplexType B1C(BARGS(_lt_Cc_));
0389     ComplexType B00C(BARGS(_lt_Cc_));
0390     ComplexType B11C(BARGS(_lt_Cc_));
0391     ComplexType B001C(BARGS(_lt_Cc_));
0392     ComplexType B111C(BARGS(_lt_Cc_));
0393     ComplexType DB0C(BARGS(_lt_Cc_));
0394     ComplexType DB1C(BARGS(_lt_Cc_));
0395     ComplexType DB00C(BARGS(_lt_Cc_));
0396     ComplexType DB11C(BARGS(_lt_Cc_));
0397 
0398     /****************************************************************/
0399 
0400     memindex Cget(CARGS(_lt_Cr_));
0401     memindex CgetC(CARGS(_lt_Cc_));
0402 
0403     void Cput(ComplexType *res, CARGS(_lt_Cr_));
0404     void CputC(ComplexType *res, CARGS(_lt_Cc_));
0405 
0406     void C0nocache(ComplexType *res, CARGS(_lt_Cr_));
0407     void C0nocacheC(ComplexType *res, CARGS(_lt_Cc_));
0408 
0409     COMPLEX *Ccache(const memindex integral);
0410     COMPLEX *CcacheC(const memindex integral);
0411 
0412     ComplexType Cval(const int i, const memindex integral);
0413     ComplexType CvalC(const int i, const memindex integral);
0414 
0415     ComplexType C0i(const int i, CARGS(_lt_Cr_));
0416     ComplexType C0iC(const int i, CARGS(_lt_Cc_));
0417 
0418     ComplexType C0(CARGS(_lt_Cr_));
0419     ComplexType C0C(CARGS(_lt_Cc_));
0420 
0421     /****************************************************************/
0422 
0423     memindex Dget(DARGS(_lt_Cr_));
0424     memindex DgetC(DARGS(_lt_Cc_));
0425 
0426     void Dput(ComplexType *res, DARGS(_lt_Cr_));
0427     void DputC(ComplexType *res, DARGS(_lt_Cc_));
0428 
0429     void D0nocache(ComplexType *res, DARGS(_lt_Cr_));
0430     void D0nocacheC(ComplexType *res, DARGS(_lt_Cc_));
0431 
0432     COMPLEX *Dcache(const memindex integral);
0433     COMPLEX *DcacheC(const memindex integral);
0434 
0435     ComplexType Dval(const int i, const memindex integral);
0436     ComplexType DvalC(const int i, const memindex integral);
0437 
0438     ComplexType D0i(const int i, DARGS(_lt_Cr_));
0439     ComplexType D0iC(const int i, DARGS(_lt_Cc_));
0440 
0441     ComplexType D0(DARGS(_lt_Cr_));
0442     ComplexType D0C(DARGS(_lt_Cc_));
0443 
0444     /****************************************************************/
0445 
0446     memindex Eget(EARGS(_lt_Cr_));
0447     memindex EgetC(EARGS(_lt_Cc_));
0448 
0449     void Eput(ComplexType *res, EARGS(_lt_Cr_));
0450     void EputC(ComplexType *res, EARGS(_lt_Cc_));
0451 
0452     void E0nocache(ComplexType *res, EARGS(_lt_Cr_));
0453     void E0nocacheC(ComplexType *res, EARGS(_lt_Cc_));
0454 
0455     COMPLEX *Ecache(const memindex integral);
0456     COMPLEX *EcacheC(const memindex integral);
0457 
0458     ComplexType Eval(const int i, const memindex integral);
0459     ComplexType EvalC(const int i, const memindex integral);
0460 
0461     ComplexType E0i(const int i, EARGS(_lt_Cr_));
0462     ComplexType E0iC(const int i, EARGS(_lt_Cc_));
0463 
0464     ComplexType E0(EARGS(_lt_Cr_));
0465     ComplexType E0C(EARGS(_lt_Cc_));
0466 
0467     /****************************************************************/
0468 
0469     ComplexType Li2(_lt_Cr_(x));
0470     ComplexType Li2C(_lt_Cc_(x));
0471     ComplexType Li2omx(_lt_Cr_(x));
0472     ComplexType Li2omxC(_lt_Cc_(x));
0473 
0474     /****************************************************************/
0475 
0476     void clearcache();
0477     void markcache();
0478     void restorecache();
0479 
0480     void setmudim(cRealType mudim);
0481     RealType getmudim();
0482 
0483     void setdelta(cRealType delta);
0484     RealType getdelta();
0485 
0486     void setuvdiv(cRealType uvdiv);
0487     RealType getuvdiv();
0488 
0489     void setlambda(cRealType lambda);
0490     RealType getlambda();
0491 
0492     void setminmass(cRealType minmass);
0493     RealType getminmass();
0494 
0495     void setmaxdev(cRealType maxdev);
0496     RealType getmaxdev();
0497 
0498     void setwarndigits(const int warndigits);
0499     int getwarndigits();
0500 
0501     void seterrdigits(const int errdigits);
0502     int geterrdigits();
0503 
0504     void setversionkey(const int versionkey);
0505     int getversionkey();
0506 
0507     void setdebugkey(const int debugkey);
0508     int getdebugkey();
0509 
0510     void setdebugrange(const int debugfrom, const int debugto);
0511 
0512     void setcmpbits(const int cmpbits);
0513     int getcmpbits();
0514 
0515     void setdiffeps(cRealType diffeps);
0516     RealType getdiffeps();
0517 
0518     void setzeroeps(cRealType zeroeps);
0519     RealType getzeroeps();
0520 
0521   } // namespace Looptools
0522 } // namespace Herwig
0523 
0524 #endif
0525