LIBINT  2.1.0-stable
OSVRR_sx_sx_deriv.h
1 /*
2  * This file is a part of Libint.
3  * Copyright (C) 2004-2014 Edward F. Valeev
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU Library General Public License, version 2,
7  * as published by the Free Software Foundation.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public License
15  * along with this program. If not, see http://www.gnu.org/licenses/.
16  *
17  */
18 
19 #ifndef _libint2_src_lib_libint_osvrrsxsxderiv_h_
20 #define _libint2_src_lib_libint_osvrrsxsxderiv_h_
21 
22 #include <cstdlib>
23 #include <libint2.h>
24 #include <util_types.h>
25 #include <libint2/cgshell_ordering.h>
26 
27 namespace libint2 {
28 
29  template <int part, int Lb, int Ld,
30  int Da_x,
31  int Da_y,
32  int Da_z,
33  int Db_x,
34  int Db_y,
35  int Db_z,
36  int Dc_x,
37  int Dc_y,
38  int Dc_z,
39  int Dd_x,
40  int Dd_y,
41  int Dd_z,
42  bool unit_a,
43  bool vectorize> struct OSVRR_sx_sx_deriv {
44  static void compute(const Libint_t* inteval,
45  LIBINT2_REALTYPE* target,
46  const LIBINT2_REALTYPE* src0,
47  const LIBINT2_REALTYPE* src1,
48  const LIBINT2_REALTYPE* src2,
49  const LIBINT2_REALTYPE* src3,
50  const LIBINT2_REALTYPE* src4,
51  const LIBINT2_REALTYPE* src5,
52  const LIBINT2_REALTYPE* src6,
53  const LIBINT2_REALTYPE* src7,
54  const LIBINT2_REALTYPE* src8,
55  const LIBINT2_REALTYPE* src9,
56  const LIBINT2_REALTYPE* src10,
57  const LIBINT2_REALTYPE* src11,
58  const LIBINT2_REALTYPE* src12,
59  const LIBINT2_REALTYPE* src13,
60  const LIBINT2_REALTYPE* src14,
61  const LIBINT2_REALTYPE* src15,
62  const LIBINT2_REALTYPE* src16,
63  const LIBINT2_REALTYPE* src17,
64  const LIBINT2_REALTYPE* src18,
65  const LIBINT2_REALTYPE* src19,
66  const LIBINT2_REALTYPE* src20,
67  const LIBINT2_REALTYPE* src21,
68  const LIBINT2_REALTYPE* src22
69  );
70  };
71 
101  template <int Lb, int Ld,
102  int Da_x,
103  int Da_y,
104  int Da_z,
105  int Db_x,
106  int Db_y,
107  int Db_z,
108  int Dc_x,
109  int Dc_y,
110  int Dc_z,
111  int Dd_x,
112  int Dd_y,
113  int Dd_z,
114  bool unit_a,
115  bool vectorize> struct OSVRR_sx_sx_deriv<0,Lb,Ld,
116  Da_x,Da_y,Da_z,
117  Db_x,Db_y,Db_z,
118  Dc_x,Dc_y,Dc_z,
119  Dd_x,Dd_y,Dd_z,
120  unit_a,
121  vectorize> {
122 
123  static void compute(const Libint_t* inteval,
124  LIBINT2_REALTYPE* target,
125  const LIBINT2_REALTYPE* src0,
126  const LIBINT2_REALTYPE* src1,
127  const LIBINT2_REALTYPE* src2,
128  const LIBINT2_REALTYPE* src3,
129  const LIBINT2_REALTYPE* src4,
130  const LIBINT2_REALTYPE* src5,
131  const LIBINT2_REALTYPE* src6,
132  const LIBINT2_REALTYPE* src7,
133  const LIBINT2_REALTYPE* src8,
134  const LIBINT2_REALTYPE* src9,
135  const LIBINT2_REALTYPE* src10,
136  const LIBINT2_REALTYPE* src11,
137  const LIBINT2_REALTYPE* src12,
138  const LIBINT2_REALTYPE* src13,
139  const LIBINT2_REALTYPE* src14,
140  const LIBINT2_REALTYPE* src15,
141  const LIBINT2_REALTYPE* src16,
142  const LIBINT2_REALTYPE* src17,
143  const LIBINT2_REALTYPE* src18,
144  const LIBINT2_REALTYPE* src19,
145  const LIBINT2_REALTYPE* src20,
146  const LIBINT2_REALTYPE* src21,
147  const LIBINT2_REALTYPE* src22
148  ) {
149 
150  // works for (sd|sp) and higher
151  assert(not (Lb < 2 || Ld < 1));
152 
153  const unsigned int veclen = vectorize ? inteval->veclen : 1;
154 
155  const unsigned int Nd = INT_NCART(Ld);
156  const unsigned int NdV = Nd * veclen;
157 
158  int bx, by, bz;
159  FOR_CART(bx, by, bz, Lb)
160 
161  int b[3]; b[0] = bx; b[1] = by; b[2] = bz;
162 
163  enum XYZ {x=0, y=1, z=2};
164  // Build along x, if possible
165  XYZ xyz = z;
166  if (by != 0) xyz = y;
167  if (bx != 0) xyz = x;
168  --b[xyz];
169 
170  // redirect
171  const LIBINT2_REALTYPE *PB, *WP;
172  switch(xyz) {
173  case x:
174 #if LIBINT2_DEFINED(eri,PB_x)
175  if (not unit_a) PB = inteval->PB_x;
176 #endif
177  WP = inteval->WP_x;
178  break;
179  case y:
180 #if LIBINT2_DEFINED(eri,PB_y)
181  if (not unit_a) PB = inteval->PB_y;
182 #endif
183  WP = inteval->WP_y;
184  break;
185  case z:
186 #if LIBINT2_DEFINED(eri,PB_z)
187  if (not unit_a) PB = inteval->PB_z;
188 #endif
189  WP = inteval->WP_z;
190  break;
191  }
192 
193  const unsigned int ibm1 = INT_CARTINDEX(Lb-1,b[0],b[1]);
194  const unsigned int bm10d0_offset = ibm1 * NdV;
195  const LIBINT2_REALTYPE* src0_ptr = (not unit_a) ? src0 + bm10d0_offset : 0;
196  const LIBINT2_REALTYPE* src1_ptr = src1 + bm10d0_offset;
197 
198  // if b-2_xyz exists, include (0 b-2_xyz | 0 d)
199  if (b[xyz] > 0) {
200  --b[xyz];
201  const unsigned int ibm2 = INT_CARTINDEX(Lb-2,b[0],b[1]);
202  const unsigned int bm20d0_offset = ibm2 * NdV;
203  ++b[xyz];
204  const LIBINT2_REALTYPE* src2_ptr = src2 + bm20d0_offset;
205  const LIBINT2_REALTYPE* src3_ptr = src3 + bm20d0_offset;
206  const LIBINT2_REALTYPE bxyz = (LIBINT2_REALTYPE)b[xyz];
207 
208  unsigned int dv = 0;
209  for(unsigned int d = 0; d < Nd; ++d) {
210  for(unsigned int v=0; v<veclen; ++v, ++dv) {
211  LIBINT2_REALTYPE value = WP[v] * src1_ptr[dv] + bxyz * inteval->oo2z[v] * (src2_ptr[dv] - inteval->roz[v] * src3_ptr[dv]);
212  if (not unit_a) value += PB[v] * src0_ptr[dv];
213  target[dv] = value;
214  }
215  }
216 #if LIBINT2_FLOP_COUNT
217  inteval->nflops[0] += (unit_a ? 6 : 8) * NdV;
218 #endif
219 
220  }
221  else {
222  unsigned int dv = 0;
223  for(unsigned int d = 0; d < Nd; ++d) {
224  for(unsigned int v=0; v<veclen; ++v, ++dv) {
225  LIBINT2_REALTYPE value = WP[v] * src1_ptr[dv];
226  if (not unit_a) value += PB[v] * src0_ptr[dv];
227  target[dv] = value;
228  }
229  }
230 #if LIBINT2_FLOP_COUNT
231  inteval->nflops[0] += (unit_a ? 1 : 3) * NdV;
232 #endif
233  }
234 
235  {
236  const unsigned int Ndm1 = INT_NCART(Ld-1);
237  const unsigned int Ndm1V = Ndm1 * veclen;
238  const unsigned int bm10dm10_offset = ibm1 * Ndm1V;
239  const LIBINT2_REALTYPE* src4_ptr = src4 + bm10dm10_offset;
240 
241  // loop over d-1 shell and include (0 b-1_xyz | 0 d-1_xyz) to (0 b | 0 d)
242  int dx, dy, dz;
243  FOR_CART(dx, dy, dz, Ld-1)
244 
245  int d[3]; d[0] = dx; d[1] = dy; d[2] = dz;
246  ++d[xyz];
247 
248  const unsigned int dc = INT_CARTINDEX(Ld,d[0],d[1]);
249  const unsigned int dc_offset = dc * veclen;
250  LIBINT2_REALTYPE* tptr = target + dc_offset;
251  const LIBINT2_REALTYPE dxyz = (LIBINT2_REALTYPE)d[xyz];
252  for(unsigned int v=0; v<veclen; ++v) {
253  tptr[v] += dxyz * inteval->oo2ze[v] * src4_ptr[v];
254  }
255 #if LIBINT2_FLOP_COUNT
256  inteval->nflops[0] += 3 * veclen;
257 #endif
258  src4_ptr += veclen;
259 
260  END_FOR_CART
261  }
262 
263 #define dcontrA(target,srcA,srcB,id,ecoef1,ecoef2) { \
264  const LIBINT2_REALTYPE* srcA_ptr = srcA + bm10d0_offset; \
265  const LIBINT2_REALTYPE* srcB_ptr = srcB + bm10d0_offset; \
266  const LIBINT2_REALTYPE di = (LIBINT2_REALTYPE)id; \
267  const LIBINT2_REALTYPE* c1 = inteval->ecoef1; \
268  const LIBINT2_REALTYPE* c2 = inteval->ecoef2; \
269  unsigned int dv = 0; \
270  for(unsigned int d = 0; d < Nd; ++d) { \
271  for(unsigned int v=0; v<veclen; ++v, ++dv) { \
272  target[dv] += di * (c1[v] * srcA_ptr[dv] - c2[v] * srcB_ptr[dv]); \
273  } \
274  } \
275 }
276 
277 #define dcontrB(target,srcA,srcB,id,ecoef1,ecoef2) { \
278  const LIBINT2_REALTYPE* srcA_ptr = srcA + bm10d0_offset; \
279  const LIBINT2_REALTYPE* srcB_ptr = srcB + bm10d0_offset; \
280  const LIBINT2_REALTYPE di = (LIBINT2_REALTYPE)id; \
281  const LIBINT2_REALTYPE* c1 = inteval->ecoef1; \
282  const LIBINT2_REALTYPE* c2 = inteval->ecoef2; \
283  unsigned int dv = 0; \
284  for(unsigned int d = 0; d < Nd; ++d) { \
285  for(unsigned int v=0; v<veclen; ++v, ++dv) { \
286  target[dv] -= di * (c1[v] * srcA_ptr[dv] + c2[v] * srcB_ptr[dv]); \
287  } \
288  } \
289 }
290 
291 #define dcontrCD(target,srcA,id,ecoef1) { \
292  const LIBINT2_REALTYPE* srcA_ptr = srcA + bm10d0_offset; \
293  const LIBINT2_REALTYPE di = (LIBINT2_REALTYPE)id; \
294  const LIBINT2_REALTYPE* c1 = inteval->ecoef1; \
295  unsigned int dv = 0; \
296  for(unsigned int d = 0; d < Nd; ++d) { \
297  for(unsigned int v=0; v<veclen; ++v, ++dv) { \
298  target[dv] += di * c1[v] * srcA_ptr[dv]; \
299  } \
300  } \
301 }
302 
303  // if Da_x-1 exists
304 #if LIBINT2_DEFINED(any,rho12_over_alpha2) && LIBINT2_DEFINED(any,alpha1_rho_over_zeta2)
305  if (Da_x > 0 && xyz == x){
306  dcontrA(target,src5,src6,Da_x,rho12_over_alpha2,alpha1_rho_over_zeta2);
307 #if LIBINT2_FLOP_COUNT
308  inteval->nflops[0] += 5 * NdV;
309 #endif
310  }
311  if (Da_y > 0 && xyz == y){
312  dcontrA(target,src11,src12,Da_y,rho12_over_alpha2,alpha1_rho_over_zeta2);
313 #if LIBINT2_FLOP_COUNT
314  inteval->nflops[0] += 5 * NdV;
315 #endif
316  }
317  if (Da_z > 0 && xyz == z){
318  dcontrA(target,src17,src18,Da_z,rho12_over_alpha2,alpha1_rho_over_zeta2);
319 #if LIBINT2_FLOP_COUNT
320  inteval->nflops[0] += 5 * NdV;
321 #endif
322  }
323 #endif
324  // if Db_x-1 exists
325 #if LIBINT2_DEFINED(any,rho12_over_alpha2) && LIBINT2_DEFINED(any,alpha2_rho_over_zeta2)
326  if (Db_x > 0 && xyz == x){
327  dcontrB(target,src7,src8,Db_x,rho12_over_alpha2,alpha2_rho_over_zeta2);
328 #if LIBINT2_FLOP_COUNT
329  inteval->nflops[0] += 5 * NdV;
330 #endif
331  }
332  if (Db_y > 0 && xyz == y){
333  dcontrB(target,src13,src14,Db_y,rho12_over_alpha2,alpha2_rho_over_zeta2);
334 #if LIBINT2_FLOP_COUNT
335  inteval->nflops[0] += 5 * NdV;
336 #endif
337  }
338  if (Db_z > 0 && xyz == z){
339  dcontrB(target,src19,src20,Db_z,rho12_over_alpha2,alpha2_rho_over_zeta2);
340 #if LIBINT2_FLOP_COUNT
341  inteval->nflops[0] += 5 * NdV;
342 #endif
343  }
344 #endif
345  // if Dc_x-1 exists
346 #if LIBINT2_DEFINED(any,alpha3_over_zetapluseta)
347  if (Dc_x > 0 && xyz == x){
348  dcontrCD(target,src9,Dc_x,alpha3_over_zetapluseta);
349 #if LIBINT2_FLOP_COUNT
350  inteval->nflops[0] += 3 * NdV;
351 #endif
352  }
353  if (Dc_y > 0 && xyz == y){
354  dcontrCD(target,src15,Dc_y,alpha3_over_zetapluseta);
355 #if LIBINT2_FLOP_COUNT
356  inteval->nflops[0] += 3 * NdV;
357 #endif
358  }
359  if (Dc_z > 0 && xyz == z){
360  dcontrCD(target,src21,Dc_z,alpha3_over_zetapluseta);
361 #if LIBINT2_FLOP_COUNT
362  inteval->nflops[0] += 3 * NdV;
363 #endif
364  }
365 #endif
366  // if Dd_x-1 exists
367 #if LIBINT2_DEFINED(any,alpha4_over_zetapluseta)
368  if (Dd_x > 0 && xyz == x){
369  dcontrCD(target,src10,Dd_x,alpha4_over_zetapluseta);
370 #if LIBINT2_FLOP_COUNT
371  inteval->nflops[0] += 3 * NdV;
372 #endif
373  }
374  if (Dd_y > 0 && xyz == y){
375  dcontrCD(target,src16,Dd_y,alpha4_over_zetapluseta);
376 #if LIBINT2_FLOP_COUNT
377  inteval->nflops[0] += 3 * NdV;
378 #endif
379  }
380  if (Dd_z > 0 && xyz == z){
381  dcontrCD(target,src22,Dd_z,alpha4_over_zetapluseta);
382 #if LIBINT2_FLOP_COUNT
383  inteval->nflops[0] += 3 * NdV;
384 #endif
385  }
386 #endif
387 
388  target += NdV;
389 
390  END_FOR_CART // end of loop over a-1
391 
393  //inteval->nflops[0] = inteval->nflops[0] + 222 * 1 * 1 * veclen;
394 
395  }
396 
397  };
398 
400  template <int part, int Lb, int Ld,
401  int Da_x,
402  int Da_y,
403  int Da_z,
404  int Db_x,
405  int Db_y,
406  int Db_z,
407  int Dc_x,
408  int Dc_y,
409  int Dc_z,
410  int Dd_x,
411  int Dd_y,
412  int Dd_z,
413  bool vectorize> struct OSAVRR_sx_sx_deriv {
414  static void compute(const Libint_t* inteval,
415  LIBINT2_REALTYPE* target,
416  const LIBINT2_REALTYPE* src1,
417  const LIBINT2_REALTYPE* src4,
418  const LIBINT2_REALTYPE* src5,
419  const LIBINT2_REALTYPE* src6,
420  const LIBINT2_REALTYPE* src7,
421  const LIBINT2_REALTYPE* src8,
422  const LIBINT2_REALTYPE* src9,
423  const LIBINT2_REALTYPE* src10,
424  const LIBINT2_REALTYPE* src11,
425  const LIBINT2_REALTYPE* src12,
426  const LIBINT2_REALTYPE* src13,
427  const LIBINT2_REALTYPE* src14,
428  const LIBINT2_REALTYPE* src15,
429  const LIBINT2_REALTYPE* src16,
430  const LIBINT2_REALTYPE* src17,
431  const LIBINT2_REALTYPE* src18,
432  const LIBINT2_REALTYPE* src19,
433  const LIBINT2_REALTYPE* src20,
434  const LIBINT2_REALTYPE* src21,
435  const LIBINT2_REALTYPE* src22
436  );
437  };
438 
465  template <int Lb, int Ld,
466  int Da_x,
467  int Da_y,
468  int Da_z,
469  int Db_x,
470  int Db_y,
471  int Db_z,
472  int Dc_x,
473  int Dc_y,
474  int Dc_z,
475  int Dd_x,
476  int Dd_y,
477  int Dd_z,
478  bool vectorize> struct OSAVRR_sx_sx_deriv<0,Lb,Ld,
479  Da_x,Da_y,Da_z,
480  Db_x,Db_y,Db_z,
481  Dc_x,Dc_y,Dc_z,
482  Dd_x,Dd_y,Dd_z,
483  vectorize> {
484 
485  static void compute(const Libint_t* inteval,
486  LIBINT2_REALTYPE* target,
487  const LIBINT2_REALTYPE* src1,
488  const LIBINT2_REALTYPE* src4,
489  const LIBINT2_REALTYPE* src5,
490  const LIBINT2_REALTYPE* src6,
491  const LIBINT2_REALTYPE* src7,
492  const LIBINT2_REALTYPE* src8,
493  const LIBINT2_REALTYPE* src9,
494  const LIBINT2_REALTYPE* src10,
495  const LIBINT2_REALTYPE* src11,
496  const LIBINT2_REALTYPE* src12,
497  const LIBINT2_REALTYPE* src13,
498  const LIBINT2_REALTYPE* src14,
499  const LIBINT2_REALTYPE* src15,
500  const LIBINT2_REALTYPE* src16,
501  const LIBINT2_REALTYPE* src17,
502  const LIBINT2_REALTYPE* src18,
503  const LIBINT2_REALTYPE* src19,
504  const LIBINT2_REALTYPE* src20,
505  const LIBINT2_REALTYPE* src21,
506  const LIBINT2_REALTYPE* src22
507  ) {
508 
509  // works for (sd|sp) and higher
510  assert(not (Lb < 2 || Ld < 1));
511 
512  const unsigned int veclen = vectorize ? inteval->veclen : 1;
513 
514  const unsigned int Nd = INT_NCART(Ld);
515  const unsigned int NdV = Nd * veclen;
516 
517  int bx, by, bz;
518  FOR_CART(bx, by, bz, Lb)
519 
520  int b[3]; b[0] = bx; b[1] = by; b[2] = bz;
521 
522  enum XYZ {x=0, y=1, z=2};
523  // Build along x, if possible
524  XYZ xyz = z;
525  if (by != 0) xyz = y;
526  if (bx != 0) xyz = x;
527  --b[xyz];
528 
529  // redirect
530  const LIBINT2_REALTYPE *WP;
531  switch(xyz) {
532  case x:
533  WP = inteval->WP_x;
534  break;
535  case y:
536  WP = inteval->WP_y;
537  break;
538  case z:
539  WP = inteval->WP_z;
540  break;
541  }
542 
543  const unsigned int ibm1 = INT_CARTINDEX(Lb-1,b[0],b[1]);
544  const unsigned int bm10d0_offset = ibm1 * NdV;
545  const LIBINT2_REALTYPE* src1_ptr = src1 + bm10d0_offset;
546 
547  {
548  unsigned int dv = 0;
549  for(unsigned int d = 0; d < Nd; ++d) {
550  for(unsigned int v=0; v<veclen; ++v, ++dv) {
551  target[dv] = WP[v] * src1_ptr[dv];
552  }
553  }
554 #if LIBINT2_FLOP_COUNT
555  inteval->nflops[0] += NdV;
556 #endif
557  }
558 
559  {
560  const unsigned int Ndm1 = INT_NCART(Ld-1);
561  const unsigned int Ndm1V = Ndm1 * veclen;
562  const unsigned int bm10dm10_offset = ibm1 * Ndm1V;
563  const LIBINT2_REALTYPE* src4_ptr = src4 + bm10dm10_offset;
564 
565  // loop over d-1 shell and include (0 b-1_xyz | 0 d-1_xyz) to (0 b | 0 d)
566  int dx, dy, dz;
567  FOR_CART(dx, dy, dz, Ld-1)
568 
569  int d[3]; d[0] = dx; d[1] = dy; d[2] = dz;
570  ++d[xyz];
571 
572  const unsigned int dc = INT_CARTINDEX(Ld,d[0],d[1]);
573  const unsigned int dc_offset = dc * veclen;
574  LIBINT2_REALTYPE* tptr = target + dc_offset;
575  const LIBINT2_REALTYPE dxyz = (LIBINT2_REALTYPE)d[xyz];
576  for(unsigned int v=0; v<veclen; ++v) {
577  tptr[v] += dxyz * inteval->oo2ze[v] * src4_ptr[v];
578  }
579 #if LIBINT2_FLOP_COUNT
580  inteval->nflops[0] += 3 * veclen;
581 #endif
582  src4_ptr += veclen;
583 
584  END_FOR_CART
585  }
586 
587 #define dcontrA(target,srcA,srcB,id,ecoef1,ecoef2) { \
588  const LIBINT2_REALTYPE* srcA_ptr = srcA + bm10d0_offset; \
589  const LIBINT2_REALTYPE* srcB_ptr = srcB + bm10d0_offset; \
590  const LIBINT2_REALTYPE di = (LIBINT2_REALTYPE)id; \
591  const LIBINT2_REALTYPE* c1 = inteval->ecoef1; \
592  const LIBINT2_REALTYPE* c2 = inteval->ecoef2; \
593  unsigned int dv = 0; \
594  for(unsigned int d = 0; d < Nd; ++d) { \
595  for(unsigned int v=0; v<veclen; ++v, ++dv) { \
596  target[dv] += di * (c1[v] * srcA_ptr[dv] - c2[v] * srcB_ptr[dv]); \
597  } \
598  } \
599 }
600 
601 #define dcontrB(target,srcA,srcB,id,ecoef1,ecoef2) { \
602  const LIBINT2_REALTYPE* srcA_ptr = srcA + bm10d0_offset; \
603  const LIBINT2_REALTYPE* srcB_ptr = srcB + bm10d0_offset; \
604  const LIBINT2_REALTYPE di = (LIBINT2_REALTYPE)id; \
605  const LIBINT2_REALTYPE* c1 = inteval->ecoef1; \
606  const LIBINT2_REALTYPE* c2 = inteval->ecoef2; \
607  unsigned int dv = 0; \
608  for(unsigned int d = 0; d < Nd; ++d) { \
609  for(unsigned int v=0; v<veclen; ++v, ++dv) { \
610  target[dv] -= di * (c1[v] * srcA_ptr[dv] + c2[v] * srcB_ptr[dv]); \
611  } \
612  } \
613 }
614 
615 #define dcontrCD(target,srcA,id,ecoef1) { \
616  const LIBINT2_REALTYPE* srcA_ptr = srcA + bm10d0_offset; \
617  const LIBINT2_REALTYPE di = (LIBINT2_REALTYPE)id; \
618  const LIBINT2_REALTYPE* c1 = inteval->ecoef1; \
619  unsigned int dv = 0; \
620  for(unsigned int d = 0; d < Nd; ++d) { \
621  for(unsigned int v=0; v<veclen; ++v, ++dv) { \
622  target[dv] += di * c1[v] * srcA_ptr[dv]; \
623  } \
624  } \
625 }
626 
627  // if Da_x-1 exists
628 #if LIBINT2_DEFINED(any,rho12_over_alpha2) && LIBINT2_DEFINED(any,alpha1_rho_over_zeta2)
629  if (Da_x > 0 && xyz == x){
630  dcontrA(target,src5,src6,Da_x,rho12_over_alpha2,alpha1_rho_over_zeta2);
631 #if LIBINT2_FLOP_COUNT
632  inteval->nflops[0] += 5 * NdV;
633 #endif
634  }
635  if (Da_y > 0 && xyz == y){
636  dcontrA(target,src11,src12,Da_y,rho12_over_alpha2,alpha1_rho_over_zeta2);
637 #if LIBINT2_FLOP_COUNT
638  inteval->nflops[0] += 5 * NdV;
639 #endif
640  }
641  if (Da_z > 0 && xyz == z){
642  dcontrA(target,src17,src18,Da_z,rho12_over_alpha2,alpha1_rho_over_zeta2);
643 #if LIBINT2_FLOP_COUNT
644  inteval->nflops[0] += 5 * NdV;
645 #endif
646  }
647 #endif
648  // if Db_x-1 exists
649 #if LIBINT2_DEFINED(any,rho12_over_alpha2) && LIBINT2_DEFINED(any,alpha2_rho_over_zeta2)
650  if (Db_x > 0 && xyz == x){
651  dcontrB(target,src7,src8,Db_x,rho12_over_alpha2,alpha2_rho_over_zeta2);
652 #if LIBINT2_FLOP_COUNT
653  inteval->nflops[0] += 5 * NdV;
654 #endif
655  }
656  if (Db_y > 0 && xyz == y){
657  dcontrB(target,src13,src14,Db_y,rho12_over_alpha2,alpha2_rho_over_zeta2);
658 #if LIBINT2_FLOP_COUNT
659  inteval->nflops[0] += 5 * NdV;
660 #endif
661  }
662  if (Db_z > 0 && xyz == z){
663  dcontrB(target,src19,src20,Db_z,rho12_over_alpha2,alpha2_rho_over_zeta2);
664 #if LIBINT2_FLOP_COUNT
665  inteval->nflops[0] += 5 * NdV;
666 #endif
667  }
668 #endif
669  // if Dc_x-1 exists
670 #if LIBINT2_DEFINED(any,alpha3_over_zetapluseta)
671  if (Dc_x > 0 && xyz == x){
672  dcontrCD(target,src9,Dc_x,alpha3_over_zetapluseta);
673 #if LIBINT2_FLOP_COUNT
674  inteval->nflops[0] += 3 * NdV;
675 #endif
676  }
677  if (Dc_y > 0 && xyz == y){
678  dcontrCD(target,src15,Dc_y,alpha3_over_zetapluseta);
679 #if LIBINT2_FLOP_COUNT
680  inteval->nflops[0] += 3 * NdV;
681 #endif
682  }
683  if (Dc_z > 0 && xyz == z){
684  dcontrCD(target,src21,Dc_z,alpha3_over_zetapluseta);
685 #if LIBINT2_FLOP_COUNT
686  inteval->nflops[0] += 3 * NdV;
687 #endif
688  }
689 #endif
690  // if Dd_x-1 exists
691 #if LIBINT2_DEFINED(any,alpha4_over_zetapluseta)
692  if (Dd_x > 0 && xyz == x){
693  dcontrCD(target,src10,Dd_x,alpha4_over_zetapluseta);
694 #if LIBINT2_FLOP_COUNT
695  inteval->nflops[0] += 3 * NdV;
696 #endif
697  }
698  if (Dd_y > 0 && xyz == y){
699  dcontrCD(target,src16,Dd_y,alpha4_over_zetapluseta);
700 #if LIBINT2_FLOP_COUNT
701  inteval->nflops[0] += 3 * NdV;
702 #endif
703  }
704  if (Dd_z > 0 && xyz == z){
705  dcontrCD(target,src22,Dd_z,alpha4_over_zetapluseta);
706 #if LIBINT2_FLOP_COUNT
707  inteval->nflops[0] += 3 * NdV;
708 #endif
709  }
710 #endif
711 
712  target += NdV;
713 
714  END_FOR_CART // end of loop over a-1
715 
717  //inteval->nflops[0] = inteval->nflops[0] + 222 * 1 * 1 * veclen;
718 
719  }
720 
721  };
722 
723 };
724 
725 #endif // header guard
726 
Defaults definitions for various parameters assumed by Libint.
Definition: algebra.cc:23
static void compute(const Libint_t *inteval, LIBINT2_REALTYPE *target, const LIBINT2_REALTYPE *src0, const LIBINT2_REALTYPE *src1, const LIBINT2_REALTYPE *src2, const LIBINT2_REALTYPE *src3, const LIBINT2_REALTYPE *src4, const LIBINT2_REALTYPE *src5, const LIBINT2_REALTYPE *src6, const LIBINT2_REALTYPE *src7, const LIBINT2_REALTYPE *src8, const LIBINT2_REALTYPE *src9, const LIBINT2_REALTYPE *src10, const LIBINT2_REALTYPE *src11, const LIBINT2_REALTYPE *src12, const LIBINT2_REALTYPE *src13, const LIBINT2_REALTYPE *src14, const LIBINT2_REALTYPE *src15, const LIBINT2_REALTYPE *src16, const LIBINT2_REALTYPE *src17, const LIBINT2_REALTYPE *src18, const LIBINT2_REALTYPE *src19, const LIBINT2_REALTYPE *src20, const LIBINT2_REALTYPE *src21, const LIBINT2_REALTYPE *src22)
Definition: OSVRR_sx_sx_deriv.h:123
static void compute(const Libint_t *inteval, LIBINT2_REALTYPE *target, const LIBINT2_REALTYPE *src1, const LIBINT2_REALTYPE *src4, const LIBINT2_REALTYPE *src5, const LIBINT2_REALTYPE *src6, const LIBINT2_REALTYPE *src7, const LIBINT2_REALTYPE *src8, const LIBINT2_REALTYPE *src9, const LIBINT2_REALTYPE *src10, const LIBINT2_REALTYPE *src11, const LIBINT2_REALTYPE *src12, const LIBINT2_REALTYPE *src13, const LIBINT2_REALTYPE *src14, const LIBINT2_REALTYPE *src15, const LIBINT2_REALTYPE *src16, const LIBINT2_REALTYPE *src17, const LIBINT2_REALTYPE *src18, const LIBINT2_REALTYPE *src19, const LIBINT2_REALTYPE *src20, const LIBINT2_REALTYPE *src21, const LIBINT2_REALTYPE *src22)
Definition: OSVRR_sx_sx_deriv.h:485
Definition: test_eri_rys.cc:46
the Ahlrichs version
Definition: OSVRR_sx_sx_deriv.h:413
Definition: OSVRR_sx_sx_deriv.h:43