1 #ifndef _ClebschGordanCoefficientSet_h_
2 #define _ClebschGordanCoefficientSet_h_
8 class ClebschGordanCoefficientSet {
12 double operator () (
unsigned int l1,
unsigned int l2,
int m1,
int m2,
int L,
int M)
const;
21 inline Key(
unsigned int l1,
unsigned int l2,
int m1,
int m2,
unsigned int L):
22 l1(l1),l2(l2),m1(m1),m2(m2),L(L) {}
25 if ( l1!=o.l1)
return l1<o.l1;
26 if ( l2!=o.l2)
return l2<o.l2;
27 if ( m1!=o.m1)
return m1<o.m1;
28 if ( m2!=o.m2)
return m2<o.m2;
29 if ( L!=o.L )
return L<o.L;
35 return l1==o.l1 && l2 == o.l2 && m1==o.m1 && m2==o.m2 && L == o.L;
50 mutable std::map<Key, double> coeff;
52 static double calcCoefficient(
int l1,
int l2,
int L,
int m1,
int m2,
int M);
60 if ((m1+m2)!=M)
return 0;
62 Key key(l1,l2,m1,m2,L);
63 std::map<Key,double>::iterator i=coeff.find(key),end=coeff.end();
65 double c = calcCoefficient(l1, l2, L, m1, m2,M);