21 #ifndef _libint2_src_lib_libint_vrrgtg1dxxxx_h_ 22 #define _libint2_src_lib_libint_vrrgtg1dxxxx_h_ 27 #include <util_types.h> 38 template <
unsigned int CartesianAxis,
int La,
int Lb,
int Lc,
int Ld,
bool vectorize>
39 struct VRR_GTG_1d_xx_xx {
41 static void compute(
const Libint_t* inteval,
42 VectorSIMD<double,npts>* target,
43 VectorSIMD<double,npts>* src0) {
45 enum XYZ {x=0, y=1, z=2};
46 assert(CartesianAxis == x || CartesianAxis == y || CartesianAxis == z);
49 const unsigned int veclen = vectorize ? inteval->veclen : 1;
52 if (La == 0 && Lb == 0 && Lc == 0 && Ld == 0) {
53 for (
unsigned int v=0; v!=veclen; ++v)
62 VectorSIMD<double,npts> apb_0_GTG_cpd_0[La+Lb+1][Lc+Ld+1];
63 apb_0_GTG_cpd_0[0][0] = src0[0];
65 const VectorSIMD<double,npts> *pfac0_0, *pfac0_1;
66 const VectorSIMD<double,npts> *pfac1_0 = inteval->R12kG12_pfac1_0;
67 const VectorSIMD<double,npts> *pfac1_1 = inteval->R12kG12_pfac1_1;
68 const VectorSIMD<double,npts> *pfac2 = inteval->R12kG12_pfac2;
69 switch (CartesianAxis) {
71 pfac0_0 = inteval->R12kG12_pfac0_0_x;
72 pfac0_1 = inteval->R12kG12_pfac0_1_x;
75 pfac0_0 = inteval->R12kG12_pfac0_0_y;
76 pfac0_1 = inteval->R12kG12_pfac0_1_y;
79 pfac0_0 = inteval->R12kG12_pfac0_0_z;
80 pfac0_1 = inteval->R12kG12_pfac0_1_z;
82 default: assert(
false);
87 apb_0_GTG_cpd_0[0][1] = pfac0_1[0] * apb_0_GTG_cpd_0[0][0];
88 #if LIBiINT2_FLOP_COUNT 89 inteval->nflops[0] += 1;
95 for(
int c_plus_d=1; c_plus_d!=Lc+Ld; ++c_plus_d) {
96 apb_0_GTG_cpd_0[0][c_plus_d+1] = pfac0_1[0] * apb_0_GTG_cpd_0[0][c_plus_d] +
97 c_plus_d * pfac1_1[0] * apb_0_GTG_cpd_0[0][c_plus_d-1];
99 #if LIBINT2_FLOP_COUNT 100 inteval->nflops[0] += 4*(Lc+Ld-1);
106 apb_0_GTG_cpd_0[1][0] = pfac0_0[0] * apb_0_GTG_cpd_0[0][0];
107 #if LIBINT2_FLOP_COUNT 108 inteval->nflops[0] += 1;
114 for(
int a_plus_b=1; a_plus_b!=La+Lb; ++a_plus_b) {
115 apb_0_GTG_cpd_0[a_plus_b+1][0] = pfac0_0[0] * apb_0_GTG_cpd_0[a_plus_b][0] +
116 a_plus_b * pfac1_0[0] * apb_0_GTG_cpd_0[a_plus_b-1][0];
118 #if LIBINT2_FLOP_COUNT 119 inteval->nflops[0] += 4*(La+Lb-1);
124 if (La+Lb > 0 && Lc+Ld > 0) {
125 for(
int c_plus_d=1; c_plus_d<=Lc+Ld; ++c_plus_d) {
126 apb_0_GTG_cpd_0[1][c_plus_d] = pfac0_0[0] * apb_0_GTG_cpd_0[0][c_plus_d] +
127 c_plus_d * pfac2[0] * apb_0_GTG_cpd_0[0][c_plus_d-1];
129 #if LIBINT2_FLOP_COUNT 130 inteval->nflops[0] += 4*(Lc+Ld-1);
135 if (La+Lb > 1 && Lc+Ld > 0) {
136 for(
int a_plus_b=1; a_plus_b!=La+Lb; ++a_plus_b) {
137 for(
int c_plus_d=1; c_plus_d<=Lc+Ld; ++c_plus_d) {
138 apb_0_GTG_cpd_0[a_plus_b+1][c_plus_d] = pfac0_0[0] * apb_0_GTG_cpd_0[a_plus_b][c_plus_d] +
139 a_plus_b * pfac1_0[0] * apb_0_GTG_cpd_0[a_plus_b-1][c_plus_d] +
140 c_plus_d * pfac2[0] * apb_0_GTG_cpd_0[a_plus_b][c_plus_d-1];
143 #if LIBINT2_FLOP_COUNT 144 inteval->nflops[0] += 7*(La+Lb-1)*(Lc+Ld-1);
153 switch (CartesianAxis) {
155 std::cout<<
"printing before segfault"<<std::endl;
156 AB[0] = inteval->AB_x[0];
159 AB[0] = inteval->AB_y[0];
162 AB[0] = inteval->AB_z[0];
164 default: assert(
false);
167 VectorSIMD<double,npts> a_b_GTG_cpd_0[La+1][Lb+1][Lc+Ld+1];
168 for(
int c_plus_d=0; c_plus_d<=Lc+Ld; ++c_plus_d) {
170 VectorSIMD<double,npts> b_a_GTG[La+Lb+1][La+Lb+1];
171 for(
int a_plus_b=0; a_plus_b<=La+Lb; ++a_plus_b) {
172 b_a_GTG[0][a_plus_b] = apb_0_GTG_cpd_0[a_plus_b][c_plus_d];
175 for(
int b=1; b<=Lb; ++b) {
176 for(
int a=0; a<=La+Lb-b; ++a) {
177 b_a_GTG[b][a] = b_a_GTG[b-1][a+1] + AB[0] * b_a_GTG[b-1][a];
179 #if LIBINT2_FLOP_COUNT 180 inteval->nflops[0] += 2 * (La+Lb-b+1);
184 for(
int b=0; b<=Lb; ++b) {
185 for(
int a=0; a<=La; ++a) {
186 a_b_GTG_cpd_0[a][b][c_plus_d] = b_a_GTG[b][a];
196 switch (CartesianAxis) {
198 CD[0] = inteval->CD_x[0];
201 CD[0] = inteval->CD_y[0];
204 CD[0] = inteval->CD_z[0];
206 default: assert(
false);
209 VectorSIMD<double,npts>* target_a_b_blk_ptr = target;
210 const int Nd = (Ld+1);
211 const int Ncd = (Lc+1)*Nd;
212 for(
int a=0; a<=La; ++a) {
213 for(
int b=0; b<=Lb; ++b, target_a_b_blk_ptr+=Ncd) {
215 VectorSIMD<double,npts> d_c_GTG[Lc+Ld+1][Lc+Ld+1];
216 for(
int c_plus_d=0; c_plus_d<=Lc+Ld; ++c_plus_d) {
217 d_c_GTG[0][c_plus_d] = a_b_GTG_cpd_0[a][b][c_plus_d];
220 for(
int d=1; d<=Ld; ++d) {
221 for(
int c=0; c<=Lc+Ld-d; ++c) {
222 d_c_GTG[d][c] = d_c_GTG[d-1][c+1] + CD[0] * d_c_GTG[d-1][c];
224 #if LIBINT2_FLOP_COUNT 225 inteval->nflops[0] += 2 * (Lc+Ld-d+1);
229 for(
int d=0; d<=Ld; ++d) {
230 for(
int c=0, cd=d; c<=Lc; ++c, cd+=Nd) {
231 target_a_b_blk_ptr[cd] = d_c_GTG[d][c];
244 #endif // header guard Defaults definitions for various parameters assumed by Libint.
Definition: algebra.cc:24