Sacado Package Browser (Single Doxygen Collection)  Version of the Day
Sacado_Fad_Exp_MathFunctions.hpp
Go to the documentation of this file.
1 // @HEADER
2 // ***********************************************************************
3 //
4 // Sacado Package
5 // Copyright (2006) Sandia Corporation
6 //
7 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
8 // the U.S. Government retains certain rights in this software.
9 //
10 // This library is free software; you can redistribute it and/or modify
11 // it under the terms of the GNU Lesser General Public License as
12 // published by the Free Software Foundation; either version 2.1 of the
13 // License, or (at your option) any later version.
14 //
15 // This library is distributed in the hope that it will be useful, but
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 // Lesser General Public License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public
21 // License along with this library; if not, write to the Free Software
22 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
23 // USA
24 // Questions? Contact David M. Gay (dmgay@sandia.gov) or Eric T. Phipps
25 // (etphipp@sandia.gov).
26 //
27 // ***********************************************************************
28 // @HEADER
29 
30 #ifndef SACADO_FAD_EXP_MATHFUNCTIONS_HPP
31 #define SACADO_FAD_EXP_MATHFUNCTIONS_HPP
32 
33 #include "Sacado_cmath.hpp"
34 #include "Sacado_SFINAE_Macros.hpp"
35 
36 #define UNARYFUNC_MACRO(OP,FADOP) \
37 namespace Sacado { \
38  \
39  namespace Fad { \
40  namespace Exp { \
41  template <typename T> class Expr; \
42  template <typename T, typename E> class FADOP; \
43  template <typename T> \
44  KOKKOS_INLINE_FUNCTION \
45  FADOP< typename Expr<T>::derived_type, \
46  typename T::expr_spec_type > \
47  OP (const Expr<T>&); \
48  } \
49  } \
50  \
51 } \
52  \
53 namespace std { \
54  using Sacado::Fad::Exp::OP; \
55 }
56 
76 
77 #undef UNARYFUNC_MACRO
78 
79 #define BINARYFUNC_MACRO(OP,FADOP) \
80 namespace Sacado { \
81  \
82  namespace Fad { \
83  namespace Exp { \
84  template <typename T> class Expr; \
85  template <typename T1, typename T2, bool, bool, typename E> \
86  class FADOP; \
87  template <typename T> struct IsFadExpr; \
88  template <typename T> struct ExprLevel; \
89  template <typename T1, typename T2> \
90  KOKKOS_INLINE_FUNCTION \
91  SACADO_FAD_EXP_OP_ENABLE_EXPR_EXPR(FADOP) \
92  OP (const T1&, const T2&); \
93  \
94  template <typename T> \
95  KOKKOS_INLINE_FUNCTION \
96  FADOP< typename T::value_type, typename Expr<T>::derived_type, \
97  true, false, typename T::expr_spec_type > \
98  OP (const typename T::value_type&, const Expr<T>&); \
99  \
100  template <typename T> \
101  KOKKOS_INLINE_FUNCTION \
102  FADOP< typename Expr<T>::derived_type, typename T::value_type, \
103  false, true, typename T::expr_spec_type > \
104  OP (const Expr<T>&, const typename T::value_type&); \
105  \
106  template <typename T> \
107  KOKKOS_INLINE_FUNCTION \
108  SACADO_FAD_EXP_OP_ENABLE_SCALAR_EXPR(FADOP) \
109  OP (const typename T::scalar_type&, const Expr<T>&); \
110  \
111  template <typename T> \
112  KOKKOS_INLINE_FUNCTION \
113  SACADO_FAD_EXP_OP_ENABLE_EXPR_SCALAR(FADOP) \
114  OP (const Expr<T>&, const typename T::scalar_type&); \
115  } \
116  } \
117  \
118 } \
119  \
120 namespace std { \
121  using Sacado::Fad::Exp::OP; \
122 }
123 
128 
129 #undef BINARYFUNC_MACRO
130 
131 #if defined(HAVE_SACADO_KOKKOSCORE)
132 
133 namespace Sacado {
134  namespace Fad {
135  namespace Exp {
136  template <typename S> class GeneralFad;
137  template <typename ValT, unsigned sl, unsigned ss, typename U>
138  class ViewFadPtr;
139 
140  template <typename S>
142  void atomic_add(GeneralFad<S>* dst, const GeneralFad<S>& x);
143 
144  template <typename ValT, unsigned sl, unsigned ss, typename U, typename T>
146  void atomic_add(ViewFadPtr<ValT,sl,ss,U> dst, const Expr<T>& x);
147  }
148  }
149 }
150 
151 namespace Kokkos {
152  using Sacado::Fad::Exp::atomic_add;
153 }
154 
155 #endif
156 
157 #endif // SACADO_FAD_EXP_MATHFUNCTIONS_HPP
cbrt(expr.val())
expr expr SinOp
asinh(expr.val())
asin(expr.val())
cosh(expr.val())
abs(expr.val())
atanh(expr.val())
expr expr expr1 expr1 expr2 expr1 expr1 c expr2 expr1 expr2 expr1 expr2 expr1 expr1 expr1 expr2 expr1 expr1 c expr2 expr1 expr2 expr1 expr2 expr1 expr1 expr1 expr1 expr1 expr1 c *expr2 expr1 c *expr2 expr1 c *expr2 expr1 expr1 expr1 expr2 expr1 expr1 c expr2 expr1 expr2 expr1 expr2 expr1 Atan2Op
expr expr CoshOp
expr expr ATanhOp
expr expr TanhOp
pow(expr1.val(), expr2.val())
expr expr SqrtOp
expr expr ASinhOp
atan(expr.val())
#define BINARYFUNC_MACRO(OP, FADOP)
#define KOKKOS_INLINE_FUNCTION
tanh(expr.val())
expr expr CosOp
#define UNARYFUNC_MACRO(OP, FADOP)
expr expr ATanOp
SimpleFad< ValueT > min(const SimpleFad< ValueT > &a, const SimpleFad< ValueT > &b)
expr expr ACosOp
sqrt(expr.val())
sinh(expr.val())
tan(expr.val())
atan2(expr1.val(), expr2.val())
sin(expr.val())
log(expr.val())
expr expr ACoshOp
expr expr Log10Op
expr expr SinhOp
acosh(expr.val())
acos(expr.val())
SimpleFad< ValueT > max(const SimpleFad< ValueT > &a, const SimpleFad< ValueT > &b)
expr expr ASinOp
exp(expr.val())
expr expr expr ExpOp
expr2 expr1 expr2 expr2 c *expr2 c *expr1 c *expr2 c *expr1 PowerOp
fabs(expr.val())
expr expr AbsOp
expr expr TanOp
log10(expr.val())
cos(expr.val())