LIBINT  2.1.0-stable
constants.h
1 
2 #ifndef _libint_constants_h_
3 #define _libint_constants_h_
4 
5 static const char cart_comp[] = "XYZ";
6 static const char am_letter[] = "0pdfghiklmnoqrtuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
7 static const char *number[] = {"zero","one","two","three","four","five","six","seven","eight","nine","ten","eleven",
8  "twelve","thirteen","fourteen","fifteen","sixteen","seventeen","eighteen","nineteen","twenty",
9  "twentyone", "twentytwo", "twentythree", "twentyfour", "twentyfive", "twentysix", "twentyseven",
10  "twentyeight", "twentynine", "thirty", "thirtyone", "thirtytwo"};
11 
12 static inline int io(int i) { return i*(i+1)/2; }
13 static inline int iop1(int i) { return (i+1)*(i+2)/2; }
14 
15 /*----------------------------------------------------------------------------------
16  hash(a,b) returns the index of the (a[0] a[1]) type product within a doublet.
17  a contains x y and z exponents of functions on centers A and B, and b contains
18  their angular momenta
19  ----------------------------------------------------------------------------------*/
20 static inline int hash(int a[2][3], int b[2])
21 {
22  int c[2] = {0,0};
23  int i;
24 
25  if(b[0]){
26  i=b[0]-a[0][0];
27  c[0]=i+io(i)-a[0][1];
28  }
29  if(b[1]){
30  i=b[1]-a[1][0];
31  c[1]=i+io(i)-a[1][1];
32  }
33 
34  return c[0]*io(b[1]+1)+c[1];
35 }
36 
37 #endif