15 double *gb,
double *pb) :
16 gmat(g), gmata(ga), gmatb(gb), pmat(p), pmata(pa), pmatb(pb) {}
19 void set_bound(
double,
double) {}
21 inline void cont1(
int ij,
int kl,
double val) {
22 gmat[ij] += val*pmat[kl];
23 gmat[kl] += val*pmat[ij];
26 inline void cont2(
int ij,
int kl,
double val) {
28 gmat[ij] -= val*pmat[kl];
29 gmat[kl] -= val*pmat[ij];
31 gmata[ij] += val*pmata[kl];
32 gmata[kl] += val*pmata[ij];
34 gmatb[ij] += val*pmatb[kl];
35 gmatb[kl] += val*pmatb[ij];
38 gmatb[ij] += val*pmata[kl];
39 gmatb[kl] += val*pmata[ij];
41 gmata[ij] += val*pmatb[kl];
42 gmata[kl] += val*pmatb[ij];
45 inline void cont3(
int ij,
int kl,
double val) {
47 gmat[ij] -= val*pmat[kl];
48 gmat[kl] -= val*pmat[ij];
50 gmata[ij] += val*pmata[kl];
51 gmata[kl] += val*pmata[ij];
53 gmatb[ij] += val*pmatb[kl];
54 gmatb[kl] += val*pmatb[ij];
57 gmata[ij] += val*pmatb[kl];
58 gmata[kl] += val*pmatb[ij];
60 gmatb[ij] += val*pmata[kl];
61 gmatb[kl] += val*pmata[ij];
64 inline void cont4(
int ij,
int kl,
double val) {
65 gmat[ij] += 0.75*val*pmat[kl];
66 gmat[kl] += 0.75*val*pmat[ij];
68 gmata[ij] += 0.25*val*pmata[kl];
69 gmata[kl] += 0.25*val*pmata[ij];
71 gmatb[ij] += 0.25*val*pmatb[kl];
72 gmatb[kl] += 0.25*val*pmatb[ij];
74 gmata[ij] -= 0.75*val*pmatb[kl];
75 gmata[kl] -= 0.75*val*pmatb[ij];
77 gmatb[ij] -= 0.75*val*pmata[kl];
78 gmatb[kl] -= 0.75*val*pmata[ij];
81 inline void cont5(
int ij,
int kl,
double val) {
83 gmat[ij] += val*pmat[kl];
84 gmat[kl] += val*pmat[ij];
86 gmata[ij] += val*pmata[kl];
87 gmata[kl] += val*pmata[ij];
89 gmatb[ij] += val*pmatb[kl];
90 gmatb[kl] += val*pmatb[ij];
93 gmata[ij] += val*pmatb[kl];
94 gmata[kl] += val*pmatb[ij];
96 gmatb[ij] += val*pmata[kl];
97 gmatb[kl] += val*pmata[ij];
104 double *
const pmata;
105 double *
const pmatb;
111 void set_bound(
double,
double) {};
114 pmat(p), pmata(pa), pmatb(pb) {
119 inline void cont1(
int ij,
int kl,
double val) {
120 ec += val*pmat[ij]*pmat[kl];
123 inline void cont2(
int ij,
int kl,
double val) {
124 ex -= 0.25*val*(pmat[ij]*pmat[kl] + pmata[ij]*pmata[kl] +
125 pmatb[ij]*pmatb[kl]);
126 ex += 0.75*val*(pmata[ij]*pmatb[kl] + pmatb[ij]*pmata[kl]);
129 inline void cont3(
int ij,
int kl,
double val) {
130 ex -= 0.5*val*(pmat[ij]*pmat[kl] + pmata[ij]*pmata[kl] +
131 pmatb[ij]*pmatb[kl]);
132 ex += 1.5*val*(pmata[ij]*pmatb[kl] + pmatb[ij]*pmata[kl]);
135 inline void cont4(
int ij,
int kl,
double val) {
136 ec += val*pmat[ij]*pmat[kl];
137 ex -= 0.25*val*(pmat[ij]*pmat[kl] + pmata[ij]*pmata[kl] +
138 pmatb[ij]*pmatb[kl]);
139 ex += 0.75*val*(pmata[ij]*pmatb[kl] + pmatb[ij]*pmata[kl]);
142 inline void cont5(
int ij,
int kl,
double val) {
143 ec += val*pmat[ij]*pmat[kl];
144 ex -= 0.5*val*(pmat[ij]*pmat[kl] + pmata[ij]*pmata[kl] +
145 pmatb[ij]*pmatb[kl]);
146 ex += 1.5*val*(pmata[ij]*pmatb[kl] + pmatb[ij]*pmata[kl]);
153 double *
const pmata;
154 double *
const pmatb;
158 pmat(p), pmata(pa), pmatb(pb) {}
161 inline double cont1(
int ij,
int kl) {
162 return pmat[ij]*pmat[kl] +
163 0.5*(pmata[ij]*pmat[kl] + pmat[ij]*pmata[kl] +
164 pmatb[ij]*pmat[kl] + pmat[ij]*pmatb[kl]) +
165 0.25*(pmata[ij]*pmata[kl] + pmatb[ij]*pmatb[kl] +
166 pmata[ij]*pmatb[kl] + pmatb[ij]*pmata[kl]);
169 inline double cont2(
int ij,
int kl) {
170 return pmat[ij]*pmat[kl] +
171 0.5*(pmata[ij]*pmat[kl] + pmat[ij]*pmata[kl] +
172 pmatb[ij]*pmat[kl] + pmat[ij]*pmatb[kl] +
173 pmata[ij]*pmata[kl] + pmatb[ij]*pmatb[kl] -
174 pmata[ij]*pmatb[kl] - pmatb[ij]*pmata[kl]);