Ewald 1D in 3D: jdu spát
[qpms.git] / qpms / gaunt.h
blob809f148bc6dc3c6f9b5d459e41b51bd65b438296
1 #ifndef GAUNT_H
2 #define GAUNT_H
3 #include <stdlib.h>
5 #define _GAUNT_H_MIN(x,y) (((x) > (y)) ? (y) : (x))
6 static inline int gaunt_q_max(int m, int n, int mu, int nu) {
7 return _GAUNT_H_MIN(n, _GAUNT_H_MIN(nu, (n+nu-abs(m+mu))/2));
9 #undef _GAUNT_H_MIN
11 void gaunt_xu(int m, int n, int mu, int nu, int qmax, double *v_aq, int *err);
12 //int gaunt(int m, int n, int mu, int nu, double *v_aq);
15 #ifdef GAUNT_PRECOMPILED
16 extern const double gaunt_table[];
17 extern const int gaunt_table_lMax;
19 // Returns given gaunt coeff. If not in range, return nan
20 // TODO distinguish between invalid input and limitations given by gaunt_table_lMax
21 double gaunt_table_retrieve_single(int m, int n, int mu, int nu, int q);
23 // returns pointer to the memory where gaunt(m, n, mu, nu, q=0) is placed
24 // returns NULL if invalid input or exceeding gaunt_table_lMax
25 double const * gaunt_table_retrieve_allq(int m, int n, int mu, int nu);
27 int gaunt_table_or_xu_fill(double *target, int m, int n, int mu, int nu);
28 #endif //GAUNT_PRECOMPILED
30 #endif //GAUNT_H