45 static void compute(
const Libint_t* inteval, LIBINT2_REALTYPE* target,
46 const LIBINT2_REALTYPE* 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) target[v] = src0[v];
63 LIBINT2_REALTYPE apb_0_GTG_cpd_0[La + Lb + 1][Lc + Ld + 1];
64 apb_0_GTG_cpd_0[0][0] = src0[0];
66 const LIBINT2_REALTYPE *pfac0_0, *pfac0_1;
67 const LIBINT2_REALTYPE* pfac1_0 = inteval->R12kG12_pfac1_0;
68 const LIBINT2_REALTYPE* pfac1_1 = inteval->R12kG12_pfac1_1;
69 const LIBINT2_REALTYPE* pfac2 = inteval->R12kG12_pfac2;
70 switch (CartesianAxis) {
72 pfac0_0 = inteval->R12kG12_pfac0_0_x;
73 pfac0_1 = inteval->R12kG12_pfac0_1_x;
76 pfac0_0 = inteval->R12kG12_pfac0_0_y;
77 pfac0_1 = inteval->R12kG12_pfac0_1_y;
80 pfac0_0 = inteval->R12kG12_pfac0_0_z;
81 pfac0_1 = inteval->R12kG12_pfac0_1_z;
89 apb_0_GTG_cpd_0[0][1] = pfac0_1[0] * apb_0_GTG_cpd_0[0][0];
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] =
99 pfac0_1[0] * apb_0_GTG_cpd_0[0][c_plus_d] +
100 c_plus_d * pfac1_1[0] * apb_0_GTG_cpd_0[0][c_plus_d - 1];
102#if LIBINT2_FLOP_COUNT
103 inteval->nflops[0] += 4 * (Lc + Ld - 1);
109 apb_0_GTG_cpd_0[1][0] = pfac0_0[0] * apb_0_GTG_cpd_0[0][0];
110#if LIBINT2_FLOP_COUNT
111 inteval->nflops[0] += 1;
117 for (
int a_plus_b = 1; a_plus_b != La + Lb; ++a_plus_b) {
118 apb_0_GTG_cpd_0[a_plus_b + 1][0] =
119 pfac0_0[0] * apb_0_GTG_cpd_0[a_plus_b][0] +
120 a_plus_b * pfac1_0[0] * apb_0_GTG_cpd_0[a_plus_b - 1][0];
122#if LIBINT2_FLOP_COUNT
123 inteval->nflops[0] += 4 * (La + Lb - 1);
128 if (La + Lb > 0 && Lc + Ld > 0) {
129 for (
int c_plus_d = 1; c_plus_d <= Lc + Ld; ++c_plus_d) {
130 apb_0_GTG_cpd_0[1][c_plus_d] =
131 pfac0_0[0] * apb_0_GTG_cpd_0[0][c_plus_d] +
132 c_plus_d * pfac2[0] * apb_0_GTG_cpd_0[0][c_plus_d - 1];
134#if LIBINT2_FLOP_COUNT
135 inteval->nflops[0] += 4 * (Lc + Ld - 1);
140 if (La + Lb > 1 && Lc + Ld > 0) {
141 for (
int a_plus_b = 1; a_plus_b != La + Lb; ++a_plus_b) {
142 for (
int c_plus_d = 1; c_plus_d <= Lc + Ld; ++c_plus_d) {
143 apb_0_GTG_cpd_0[a_plus_b + 1][c_plus_d] =
144 pfac0_0[0] * apb_0_GTG_cpd_0[a_plus_b][c_plus_d] +
145 a_plus_b * pfac1_0[0] * apb_0_GTG_cpd_0[a_plus_b - 1][c_plus_d] +
146 c_plus_d * pfac2[0] * apb_0_GTG_cpd_0[a_plus_b][c_plus_d - 1];
149#if LIBINT2_FLOP_COUNT
150 inteval->nflops[0] += 7 * (La + Lb - 1) * (Lc + Ld - 1);
158 const LIBINT2_REALTYPE* AB;
159 switch (CartesianAxis) {
173 LIBINT2_REALTYPE a_b_GTG_cpd_0[La + 1][Lb + 1][Lc + Ld + 1];
174 for (
int c_plus_d = 0; c_plus_d <= Lc + Ld; ++c_plus_d) {
176 LIBINT2_REALTYPE b_a_GTG[La + Lb + 1][La + Lb + 1];
177 for (
int a_plus_b = 0; a_plus_b <= La + Lb; ++a_plus_b) {
178 b_a_GTG[0][a_plus_b] = apb_0_GTG_cpd_0[a_plus_b][c_plus_d];
181 for (
int b = 1; b <= Lb; ++b) {
182 for (
int a = 0; a <= La + Lb - b; ++a) {
183 b_a_GTG[b][a] = b_a_GTG[b - 1][a + 1] + AB[0] * b_a_GTG[b - 1][a];
185#if LIBINT2_FLOP_COUNT
186 inteval->nflops[0] += 2 * (La + Lb - b + 1);
190 for (
int b = 0; b <= Lb; ++b) {
191 for (
int a = 0; a <= La; ++a) {
192 a_b_GTG_cpd_0[a][b][c_plus_d] = b_a_GTG[b][a];
201 const LIBINT2_REALTYPE* CD;
202 switch (CartesianAxis) {
216 LIBINT2_REALTYPE* target_a_b_blk_ptr = target;
217 const int Nd = (Ld + 1);
218 const int Ncd = (Lc + 1) * Nd;
219 for (
int a = 0; a <= La; ++a) {
220 for (
int b = 0; b <= Lb; ++b, target_a_b_blk_ptr += Ncd) {
222 LIBINT2_REALTYPE d_c_GTG[Lc + Ld + 1][Lc + Ld + 1];
223 for (
int c_plus_d = 0; c_plus_d <= Lc + Ld; ++c_plus_d) {
224 d_c_GTG[0][c_plus_d] = a_b_GTG_cpd_0[a][b][c_plus_d];
227 for (
int d = 1; d <= Ld; ++d) {
228 for (
int c = 0; c <= Lc + Ld - d; ++c) {
229 d_c_GTG[d][c] = d_c_GTG[d - 1][c + 1] + CD[0] * d_c_GTG[d - 1][c];
231#if LIBINT2_FLOP_COUNT
232 inteval->nflops[0] += 2 * (Lc + Ld - d + 1);
236 for (
int d = 0; d <= Ld; ++d) {
237 for (
int c = 0, cd = d; c <= Lc; ++c, cd += Nd) {
238 target_a_b_blk_ptr[cd] = d_c_GTG[d][c];