From 261b6686bd3e14c5535de62a007c461b055b7c7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ne=C4=8Dada?= Date: Thu, 13 Apr 2017 12:43:25 +0300 Subject: [PATCH] Fix qmax Former-commit-id: 64b1e7690c2761168b05c3b87f978e4c9f478deb --- qpms/gaunt.c | 15 ++++++++++++++- qpms/gaunt.h | 2 +- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/qpms/gaunt.c b/qpms/gaunt.c index 013f39b..498ddd9 100644 --- a/qpms/gaunt.c +++ b/qpms/gaunt.c @@ -1,7 +1,18 @@ -#include +#include "gaunt.h" +#ifdef USE_FORTRAN_GAUNT_XU +void __vec_trans_MOD_gaunt_xu(const double *m, const double *n, const double *mu, const double *nu, const int *qmax, double *v_aq, int *err); + +void gaunt_xu(int m, int n, int mu, int nu, int qmax, double *v_aq, int *err) { + double mf = m, nf=n, muf=mu,nuf=nu; + __vec_trans_MOD_gaunt_xu(&mf,&nf,&muf,&nuf,&qmax,v_aq,err); +} + +#else //!USE_FORTRAN_GAUNT_XU +//#include #include #include #include + #define ZERO_THRESHOLD 1.e-8 #define BF_PREC 1.e-10 // "Besides, the determined Real Programmer can write FORTRAN programs in any language." @@ -1214,3 +1225,5 @@ int main() return 0; } #endif //GAUNTTEST + +#endif //USE_FORTRAN_GAUNT_XU diff --git a/qpms/gaunt.h b/qpms/gaunt.h index a28dafa..3aa72ef 100644 --- a/qpms/gaunt.h +++ b/qpms/gaunt.h @@ -4,7 +4,7 @@ #define _GAUNT_H_MIN(x,y) (((x) > (y)) ? (y) : (x)) static inline int gaunt_q_max(int m, int n, int mu, int nu) { - return _GAUNT_H_MIN(n, _GAUNT_H_MIN(nu, n+nu-abs(m+mu))); + return _GAUNT_H_MIN(n, _GAUNT_H_MIN(nu, (n+nu-abs(m+mu))/2)); } #undef _GAUNT_H_MIN