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