19 #ifndef _libint2_src_lib_libint_vrrgtg1dxxxx_h_ 20 #define _libint2_src_lib_libint_vrrgtg1dxxxx_h_ 25 #include <util_types.h> 40 template <
unsigned int CartesianAxis,
int La,
int Lb,
int Lc,
int Ld,
bool vectorize>
41 struct VRR_GTG_1d_xx_xx {
43 static void compute(
const Libint_t* inteval,
44 VectorSIMD<double,npts>* target,
45 VectorSIMD<double,npts>* src0) {
47 enum XYZ {x=0, y=1, z=2};
48 assert(CartesianAxis == x || CartesianAxis == y || CartesianAxis == z);
51 const unsigned int veclen = vectorize ? inteval->veclen : 1;
54 if (La == 0 && Lb == 0 && Lc == 0 && Ld == 0) {
55 for (
unsigned int v=0; v!=veclen; ++v)
64 VectorSIMD<double,npts> apb_0_GTG_cpd_0[La+Lb+1][Lc+Ld+1];
65 apb_0_GTG_cpd_0[0][0] = src0[0];
67 const VectorSIMD<double,npts> *pfac0_0, *pfac0_1;
68 const VectorSIMD<double,npts> *pfac1_0 = inteval->R12kG12_pfac1_0;
69 const VectorSIMD<double,npts> *pfac1_1 = inteval->R12kG12_pfac1_1;
70 const VectorSIMD<double,npts> *pfac2 = inteval->R12kG12_pfac2;
71 switch (CartesianAxis) {
73 pfac0_0 = inteval->R12kG12_pfac0_0_x;
74 pfac0_1 = inteval->R12kG12_pfac0_1_x;
77 pfac0_0 = inteval->R12kG12_pfac0_0_y;
78 pfac0_1 = inteval->R12kG12_pfac0_1_y;
81 pfac0_0 = inteval->R12kG12_pfac0_0_z;
82 pfac0_1 = inteval->R12kG12_pfac0_1_z;
84 default: assert(
false);
89 apb_0_GTG_cpd_0[0][1] = pfac0_1[0] * apb_0_GTG_cpd_0[0][0];
90 #if LIBiINT2_FLOP_COUNT 91 inteval->nflops[0] += 1;
97 for(
int c_plus_d=1; c_plus_d!=Lc+Ld; ++c_plus_d) {
98 apb_0_GTG_cpd_0[0][c_plus_d+1] = pfac0_1[0] * apb_0_GTG_cpd_0[0][c_plus_d] +
99 c_plus_d * pfac1_1[0] * apb_0_GTG_cpd_0[0][c_plus_d-1];
101 #if LIBINT2_FLOP_COUNT 102 inteval->nflops[0] += 4*(Lc+Ld-1);
108 apb_0_GTG_cpd_0[1][0] = pfac0_0[0] * apb_0_GTG_cpd_0[0][0];
109 #if LIBINT2_FLOP_COUNT 110 inteval->nflops[0] += 1;
116 for(
int a_plus_b=1; a_plus_b!=La+Lb; ++a_plus_b) {
117 apb_0_GTG_cpd_0[a_plus_b+1][0] = pfac0_0[0] * apb_0_GTG_cpd_0[a_plus_b][0] +
118 a_plus_b * pfac1_0[0] * apb_0_GTG_cpd_0[a_plus_b-1][0];
120 #if LIBINT2_FLOP_COUNT 121 inteval->nflops[0] += 4*(La+Lb-1);
126 if (La+Lb > 0 && Lc+Ld > 0) {
127 for(
int c_plus_d=1; c_plus_d<=Lc+Ld; ++c_plus_d) {
128 apb_0_GTG_cpd_0[1][c_plus_d] = pfac0_0[0] * apb_0_GTG_cpd_0[0][c_plus_d] +
129 c_plus_d * pfac2[0] * apb_0_GTG_cpd_0[0][c_plus_d-1];
131 #if LIBINT2_FLOP_COUNT 132 inteval->nflops[0] += 4*(Lc+Ld-1);
137 if (La+Lb > 1 && Lc+Ld > 0) {
138 for(
int a_plus_b=1; a_plus_b!=La+Lb; ++a_plus_b) {
139 for(
int c_plus_d=1; c_plus_d<=Lc+Ld; ++c_plus_d) {
140 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] +
141 a_plus_b * pfac1_0[0] * apb_0_GTG_cpd_0[a_plus_b-1][c_plus_d] +
142 c_plus_d * pfac2[0] * apb_0_GTG_cpd_0[a_plus_b][c_plus_d-1];
145 #if LIBINT2_FLOP_COUNT 146 inteval->nflops[0] += 7*(La+Lb-1)*(Lc+Ld-1);
155 switch (CartesianAxis) {
157 std::cout<<
"printing before segfault"<<std::endl;
158 AB[0] = inteval->AB_x[0];
161 AB[0] = inteval->AB_y[0];
164 AB[0] = inteval->AB_z[0];
166 default: assert(
false);
169 VectorSIMD<double,npts> a_b_GTG_cpd_0[La+1][Lb+1][Lc+Ld+1];
170 for(
int c_plus_d=0; c_plus_d<=Lc+Ld; ++c_plus_d) {
172 VectorSIMD<double,npts> b_a_GTG[La+Lb+1][La+Lb+1];
173 for(
int a_plus_b=0; a_plus_b<=La+Lb; ++a_plus_b) {
174 b_a_GTG[0][a_plus_b] = apb_0_GTG_cpd_0[a_plus_b][c_plus_d];
177 for(
int b=1; b<=Lb; ++b) {
178 for(
int a=0; a<=La+Lb-b; ++a) {
179 b_a_GTG[b][a] = b_a_GTG[b-1][a+1] + AB[0] * b_a_GTG[b-1][a];
181 #if LIBINT2_FLOP_COUNT 182 inteval->nflops[0] += 2 * (La+Lb-b+1);
186 for(
int b=0; b<=Lb; ++b) {
187 for(
int a=0; a<=La; ++a) {
188 a_b_GTG_cpd_0[a][b][c_plus_d] = b_a_GTG[b][a];
198 switch (CartesianAxis) {
200 CD[0] = inteval->CD_x[0];
203 CD[0] = inteval->CD_y[0];
206 CD[0] = inteval->CD_z[0];
208 default: assert(
false);
211 VectorSIMD<double,npts>* target_a_b_blk_ptr = target;
212 const int Nd = (Ld+1);
213 const int Ncd = (Lc+1)*Nd;
214 for(
int a=0; a<=La; ++a) {
215 for(
int b=0; b<=Lb; ++b, target_a_b_blk_ptr+=Ncd) {
217 VectorSIMD<double,npts> d_c_GTG[Lc+Ld+1][Lc+Ld+1];
218 for(
int c_plus_d=0; c_plus_d<=Lc+Ld; ++c_plus_d) {
219 d_c_GTG[0][c_plus_d] = a_b_GTG_cpd_0[a][b][c_plus_d];
222 for(
int d=1; d<=Ld; ++d) {
223 for(
int c=0; c<=Lc+Ld-d; ++c) {
224 d_c_GTG[d][c] = d_c_GTG[d-1][c+1] + CD[0] * d_c_GTG[d-1][c];
226 #if LIBINT2_FLOP_COUNT 227 inteval->nflops[0] += 2 * (Lc+Ld-d+1);
231 for(
int d=0; d<=Ld; ++d) {
232 for(
int c=0, cd=d; c<=Lc; ++c, cd+=Nd) {
233 target_a_b_blk_ptr[cd] = d_c_GTG[d][c];
246 #endif // header guard Defaults definitions for various parameters assumed by Libint.
Definition: algebra.cc:23
Definition: test_eri_rys.cc:46