MPQC 2.3.1

- Main Page
- Related Pages
- Classes
- Files

- File List

clkstmpl.h

    00001
    00002 namespace sc {
    00003
    00004 class LocalCLKSContribution {
    00005   private:
    00006     double * const gmat;
    00007     double * const pmat;
    00008     double a0;
    00009
    00010   public:
    00011     LocalCLKSContribution(double *g, double *p, double a) :
    00012       gmat(g), pmat(p), a0(a) {}
    00013     ~LocalCLKSContribution() {}
    00014
    00015     void set_bound(double, double) {}
    00016
    00017     inline void cont1(int ij, int kl, double val) {
    00018       gmat[ij] += val*pmat[kl];
    00019       gmat[kl] += val*pmat[ij];
    00020     }
    00021
    00022     inline void cont2(int ij, int kl, double val) {
    00023       val *= -0.25*a0;
    00024       gmat[ij] += val*pmat[kl];
    00025       gmat[kl] += val*pmat[ij];
    00026     }
    00027
    00028     inline void cont3(int ij, int kl, double val) {
    00029       val *= -0.5*a0;
    00030       gmat[ij] += val*pmat[kl];
    00031       gmat[kl] += val*pmat[ij];
    00032     }
    00033
    00034     inline void cont4(int ij, int kl, double val) {
    00035       val *= 1.0 - 0.25*a0;
    00036       gmat[ij] += val*pmat[kl];
    00037       gmat[kl] += val*pmat[ij];
    00038     }
    00039
    00040     inline void cont5(int ij, int kl, double val) {
    00041       val *= 1.0 - 0.5*a0;
    00042       gmat[ij] += val*pmat[kl];
    00043       gmat[kl] += val*pmat[ij];
    00044     }
    00045 };
    00046
    00047 class LocalCLKSEnergyContribution {
    00048   private:
    00049     double * const pmat;
    00050     double a0;
    00051
    00052   public:
    00053     double ec;
    00054     double ex;
    00055
    00056     LocalCLKSEnergyContribution(double *p, double a) : pmat(p), a0(a) {
    00057       ec=ex=0;
    00058     }
    00059     ~LocalCLKSEnergyContribution() {}
    00060
    00061     void set_bound(double, double) {}
    00062
    00063     inline void cont1(int ij, int kl, double val) {
    00064       ec += val*pmat[ij]*pmat[kl];
    00065     }
    00066
    00067     inline void cont2(int ij, int kl, double val) {
    00068       ex -= a0*0.25*val*pmat[ij]*pmat[kl];
    00069     }
    00070
    00071     inline void cont3(int ij, int kl, double val) {
    00072       ex -= a0*0.5*val*pmat[ij]*pmat[kl];
    00073     }
    00074
    00075     inline void cont4(int ij, int kl, double val) {
    00076       ec += val*pmat[ij]*pmat[kl];
    00077       ex -= a0*0.25*val*pmat[ij]*pmat[kl];
    00078     }
    00079
    00080     inline void cont5(int ij, int kl, double val) {
    00081       ec += val*pmat[ij]*pmat[kl];
    00082       ex -= a0*0.5*val*pmat[ij]*pmat[kl];
    00083     }
    00084 };
    00085
    00086 }