13 gmata(ga), gmatb(gb), pmata(pa), pmatb(pb) {}
16 void set_bound(
double,
double) {};
18 inline void cont1(
int ij,
int kl,
double val) {
19 gmata[ij] += val*(pmata[kl]+pmatb[kl]);
20 gmata[kl] += val*(pmata[ij]+pmatb[ij]);
22 gmatb[ij] += val*(pmata[kl]+pmatb[kl]);
23 gmatb[kl] += val*(pmata[ij]+pmatb[ij]);
26 inline void cont2(
int ij,
int kl,
double val) {
28 gmata[ij] -= val*pmata[kl];
29 gmata[kl] -= val*pmata[ij];
31 gmatb[ij] -= val*pmatb[kl];
32 gmatb[kl] -= val*pmatb[ij];
35 inline void cont3(
int ij,
int kl,
double val) {
36 gmata[ij] -= val*pmata[kl];
37 gmata[kl] -= val*pmata[ij];
39 gmatb[ij] -= val*pmatb[kl];
40 gmatb[kl] -= val*pmatb[ij];
43 inline void cont4(
int ij,
int kl,
double val) {
48 inline void cont5(
int ij,
int kl,
double val) {
69 void set_bound(
double,
double) {};
71 inline void cont1(
int ij,
int kl,
double val) {
72 ec += val*(pmata[ij]+pmatb[ij])*(pmata[kl]+pmatb[kl]);
75 inline void cont2(
int ij,
int kl,
double val) {
76 ex -= 0.5*val*(pmata[ij]*pmata[kl]+pmatb[ij]*pmatb[kl]);
79 inline void cont3(
int ij,
int kl,
double val) {
80 ex -= val*(pmata[ij]*pmata[kl]+pmatb[ij]*pmatb[kl]);
83 inline void cont4(
int ij,
int kl,
double val) {
88 inline void cont5(
int ij,
int kl,
double val) {
103 inline double cont1(
int ij,
int kl) {
104 return (pmata[ij]*pmata[kl])+(pmatb[ij]*pmatb[kl]) +
105 (pmata[ij]*pmatb[kl])+(pmatb[ij]*pmata[kl]);
108 inline double cont2(
int ij,
int kl) {
109 return 2*((pmata[ij]*pmata[kl])+(pmatb[ij]*pmatb[kl]));