MPQC 2.3.1

- Main Page
- Related Pages
- Classes
- Files

- File List

clkstmpl.h
1
2 namespace sc {
3
4 class LocalCLKSContribution {
5 private:
6 double * const gmat;
7 double * const pmat;
8 double a0;
9
10 public:
11 LocalCLKSContribution(double *g, double *p, double a) :
12 gmat(g), pmat(p), a0(a) {}
13 ~LocalCLKSContribution() {}
14
15 void set_bound(double, double) {}
16
17 inline void cont1(int ij, int kl, double val) {
18 gmat[ij] += val*pmat[kl];
19 gmat[kl] += val*pmat[ij];
20 }
21
22 inline void cont2(int ij, int kl, double val) {
23 val *= -0.25*a0;
24 gmat[ij] += val*pmat[kl];
25 gmat[kl] += val*pmat[ij];
26 }
27
28 inline void cont3(int ij, int kl, double val) {
29 val *= -0.5*a0;
30 gmat[ij] += val*pmat[kl];
31 gmat[kl] += val*pmat[ij];
32 }
33
34 inline void cont4(int ij, int kl, double val) {
35 val *= 1.0 - 0.25*a0;
36 gmat[ij] += val*pmat[kl];
37 gmat[kl] += val*pmat[ij];
38 }
39
40 inline void cont5(int ij, int kl, double val) {
41 val *= 1.0 - 0.5*a0;
42 gmat[ij] += val*pmat[kl];
43 gmat[kl] += val*pmat[ij];
44 }
45 };
46
47 class LocalCLKSEnergyContribution {
48 private:
49 double * const pmat;
50 double a0;
51
52 public:
53 double ec;
54 double ex;
55
56 LocalCLKSEnergyContribution(double *p, double a) : pmat(p), a0(a) {
57 ec=ex=0;
58 }
59 ~LocalCLKSEnergyContribution() {}
60
61 void set_bound(double, double) {}
62
63 inline void cont1(int ij, int kl, double val) {
64 ec += val*pmat[ij]*pmat[kl];
65 }
66
67 inline void cont2(int ij, int kl, double val) {
68 ex -= a0*0.25*val*pmat[ij]*pmat[kl];
69 }
70
71 inline void cont3(int ij, int kl, double val) {
72 ex -= a0*0.5*val*pmat[ij]*pmat[kl];
73 }
74
75 inline void cont4(int ij, int kl, double val) {
76 ec += val*pmat[ij]*pmat[kl];
77 ex -= a0*0.25*val*pmat[ij]*pmat[kl];
78 }
79
80 inline void cont5(int ij, int kl, double val) {
81 ec += val*pmat[ij]*pmat[kl];
82 ex -= a0*0.5*val*pmat[ij]*pmat[kl];
83 }
84 };
85
86 }