LIBINT  2.1.0-stable
intrinsic_operations.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_include_libint2intrinsicoperations_h_
20 #define _libint2_include_libint2intrinsicoperations_h_
21 
22 #ifdef __cplusplus
23 
24 namespace libint2 {
25 
27 
29  template <typename X, typename Y, typename Z>
30  inline Z fma_plus(X x, Y y, Z z) {
31  return x*y + z;
32  }
33 
35  template <typename X, typename Y, typename Z>
36  inline Z fma_minus(X x, Y y, Z z) {
37  return x*y - z;
38  }
39 
41 
42 };
43 
48 #define _libint2_static_api_bzero_short_(X,nelem) for(int i=0; i < (nelem); ++i) { (X)[i] = 0.0; }
49 
50 #define _libint2_static_api_copy_short_(X,Y,nelem) for(int i=0; i < (nelem); ++i) { (X)[i] = (Y)[i]; }
51 
52 #define _libint2_static_api_scale_short_(X,Y,nelem,a) for(int i=0; i < (nelem); ++i) { (X)[i] = (a) * (Y)[i]; }
53 
54 #define _libint2_static_api_scale_vec_short_(X,Y,nelem,a,vl) for(int i=0, iv=0; i < (nelem)/(vl); ++i) { for(int v=0; v < (vl); ++v, ++iv) { (X)[iv] = (a)[v] * (Y)[iv]; } }
55 
56 #define _libint2_static_api_inc_short_(X,Y,nelem,a) for(int i=0; i < (nelem); ++i) { (X)[i] = libint2::fma_plus((a),(Y)[i],(X)[i]); }
57 
58 #define _libint2_static_api_inc1_short_(X,Y,nelem) for(int i=0; i < (nelem); ++i) { (X)[i] += (Y)[i]; }
59 
60 #endif
61 
62 #endif
Z fma_minus(X x, Y y, Z z)
Definition: intrinsic_operations.h:36
Defaults definitions for various parameters assumed by Libint.
Definition: algebra.cc:23
Z fma_plus(X x, Y y, Z z)
Definition: intrinsic_operations.h:30