QPMS
Electromagnetic multiple scattering library and toolkit.
gaunt.h
Go to the documentation of this file.
1 
4 #ifndef GAUNT_H
5 #define GAUNT_H
6 #include <stdlib.h>
7 
8 #define _GAUNT_H_MIN(x,y) (((x) > (y)) ? (y) : (x))
9 static inline int gaunt_q_max(int m, int n, int mu, int nu) {
10  return _GAUNT_H_MIN(n, _GAUNT_H_MIN(nu, (n+nu-abs(m+mu))/2));
11 }
12 #undef _GAUNT_H_MIN
13 
14 void gaunt_xu(int m, int n, int mu, int nu, int qmax, double *v_aq, int *err);
15 //int gaunt(int m, int n, int mu, int nu, double *v_aq);
16 
17 
18 #ifdef GAUNT_PRECOMPILED
19 extern const double gaunt_table[];
20 extern const int gaunt_table_lMax;
21 
22 // Returns given gaunt coeff. If not in range, return nan
23 // TODO distinguish between invalid input and limitations given by gaunt_table_lMax
24 double gaunt_table_retrieve_single(int m, int n, int mu, int nu, int q);
25 
26 // returns pointer to the memory where gaunt(m, n, mu, nu, q=0) is placed
27 // returns NULL if invalid input or exceeding gaunt_table_lMax
28 double const * gaunt_table_retrieve_allq(int m, int n, int mu, int nu);
29 
30 int gaunt_table_or_xu_fill(double *target, int m, int n, int mu, int nu);
31 #endif //GAUNT_PRECOMPILED
32 
33 #endif //GAUNT_H