1#ifndef _ClebschGordanCoefficientSet_h_
2#define _ClebschGordanCoefficientSet_h_
12 double operator () (
unsigned int l1,
unsigned int l2,
int m1,
int m2,
int L,
int M)
const;
21 inline Key(
unsigned int xl1,
unsigned int xl2,
int xm1,
int xm2,
unsigned int xL):
22 l1(xl1),l2(xl2),m1(xm1),m2(xm2),L(xL) {}
24 inline bool operator < (
const Key & o)
const {
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;
34 inline bool operator== (
const Key & o)
const {
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);
double operator()(unsigned int l1, unsigned int l2, int m1, int m2, int L, int M) const