10 #ifndef STOKHOS_SACADO_KOKKOS_MATHFUNCTIONS_HPP
11 #define STOKHOS_SACADO_KOKKOS_MATHFUNCTIONS_HPP
17 #include "Kokkos_Macros.hpp"
19 #ifdef HAVE_STOKHOS_ENSEMBLE_SCALAR_TYPE
21 #if STOKHOS_USE_MP_VECTOR_SFS_SPEC
22 #define UNARYFUNC_MACRO_SFS(OP,FADOP) \
24 template <typename O, typename T, int N, typename D> \
25 class StaticFixedStorage; \
29 template <typename S> class Vector; \
30 template <typename O, typename T, int N, typename D> \
31 KOKKOS_INLINE_FUNCTION \
32 Vector< Stokhos::StaticFixedStorage<O,T,N,D> > \
33 OP (const Vector< Stokhos::StaticFixedStorage<O,T,N,D> >&); \
37 #define UNARYFUNC_MACRO_SFS(OP,FADOP)
40 #define UNARYFUNC_MACRO(OP,FADOP) \
41 UNARYFUNC_MACRO_SFS(OP,FADOP) \
45 template <typename T> class FADOP; \
46 template <typename T> class Expr; \
48 template <typename T> \
49 KOKKOS_INLINE_FUNCTION \
51 OP (const Expr<T>&); \
57 using Sacado::MP::OP; \
81 #undef UNARYFUNC_MACRO
82 #undef UNARYFUNC_MACRO_SFS
84 #if STOKHOS_USE_MP_VECTOR_SFS_SPEC
85 #define BINARYFUNC_MACRO_SFS(OP,FADOP) \
87 template <typename O, typename T, int N, typename D> \
88 class StaticFixedStorage; \
92 template <typename S> class Vector; \
93 template <typename O, typename T, int N, typename D> \
94 KOKKOS_INLINE_FUNCTION \
95 Vector< Stokhos::StaticFixedStorage<O,T,N,D> > \
96 OP (const Vector< Stokhos::StaticFixedStorage<O,T,N,D> >&, \
97 const Vector< Stokhos::StaticFixedStorage<O,T,N,D> >&); \
99 template <typename O, typename T, int N, typename D> \
100 KOKKOS_INLINE_FUNCTION \
101 Vector< Stokhos::StaticFixedStorage<O,T,N,D> > \
102 OP (const typename Vector< Stokhos::StaticFixedStorage<O,T,N,D> >::value_type&, \
103 const Vector< Stokhos::StaticFixedStorage<O,T,N,D> >&); \
105 template <typename O, typename T, int N, typename D> \
106 KOKKOS_INLINE_FUNCTION \
107 Vector< Stokhos::StaticFixedStorage<O,T,N,D> > \
108 OP (const Vector< Stokhos::StaticFixedStorage<O,T,N,D> >&, \
109 const typename Vector< Stokhos::StaticFixedStorage<O,T,N,D> >::value_type&); \
113 #define BINARYFUNC_MACRO_SFS(OP,FADOP)
116 #define BINARYFUNC_MACRO(OP,FADOP) \
117 BINARYFUNC_MACRO_SFS(OP,FADOP) \
121 template <typename T1, typename T2> class FADOP; \
122 template <typename T> class Expr; \
124 template <typename T1, typename T2> \
125 KOKKOS_INLINE_FUNCTION \
127 OP (const Expr<T1>&, \
130 template <typename T> \
131 KOKKOS_INLINE_FUNCTION \
132 FADOP< typename T::value_type, T > \
133 OP (const typename T::value_type&, \
136 template <typename T> \
137 KOKKOS_INLINE_FUNCTION \
138 FADOP< T, typename T::value_type > \
139 OP (const Expr<T>&, \
140 const typename T::value_type&); \
145 using Sacado::MP::OP; \
155 #undef BINARYFUNC_MACRO
156 #undef BINARYFUNC_MACRO_SFS
160 #ifdef HAVE_STOKHOS_PCE_SCALAR_TYPE
162 #define UNARYFUNC_MACRO(OP,FADOP) \
166 template <typename S> class PCE; \
167 template <typename S> \
168 KOKKOS_INLINE_FUNCTION \
169 PCE<S> OP (const PCE<S>&); \
174 using Sacado::UQ::OP; \
198 #undef UNARYFUNC_MACRO
200 #define BINARYFUNC_MACRO(OP) \
204 template <typename S> class PCE; \
205 template <typename S> \
206 KOKKOS_INLINE_FUNCTION \
207 PCE<S> OP (const PCE<S>&, const PCE<S>&); \
208 template <typename S> \
209 KOKKOS_INLINE_FUNCTION \
210 PCE<S> OP (const typename PCE<S>::value_type&, const PCE<S>&); \
211 template <typename S> \
212 KOKKOS_INLINE_FUNCTION \
213 PCE<S> OP (const PCE<S>&, const typename PCE<S>::value_type&); \
218 using Sacado::UQ::OP; \
224 #undef BINARYFUNC_MACRO
226 #define BINARYFUNC_MACRO(OP) \
230 template <typename S> class PCE; \
231 template <typename S> \
232 KOKKOS_INLINE_FUNCTION \
233 PCE<S> OP (const typename S::value_type&, const PCE<S>&); \
234 template <typename S> \
235 KOKKOS_INLINE_FUNCTION \
236 PCE<S> OP (const PCE<S>&, const typename S::value_type&); \
241 using Sacado::UQ::OP; \
247 #undef BINARYFUNC_MACRO
251 #endif // STOKHOS_SACADO_KOKKOS_MATHFUNCTIONS_HPP
KOKKOS_INLINE_FUNCTION PCE< Storage > sqrt(const PCE< Storage > &a)
KOKKOS_INLINE_FUNCTION PCE< Storage > fabs(const PCE< Storage > &a)
KOKKOS_INLINE_FUNCTION PCE< Storage > tan(const PCE< Storage > &a)
KOKKOS_INLINE_FUNCTION PCE< Storage > sinh(const PCE< Storage > &a)
KOKKOS_INLINE_FUNCTION PCE< Storage > pow(const PCE< Storage > &a, const PCE< Storage > &b)
KOKKOS_INLINE_FUNCTION PCE< Storage > tanh(const PCE< Storage > &a)
KOKKOS_INLINE_FUNCTION PCE< Storage > cbrt(const PCE< Storage > &a)
#define UNARYFUNC_MACRO(OP, FADOP)
KOKKOS_INLINE_FUNCTION PCE< Storage > acos(const PCE< Storage > &a)
atan2(expr1.val(), expr2.val())
KOKKOS_INLINE_FUNCTION PCE< Storage > min(const typename PCE< Storage >::value_type &a, const PCE< Storage > &b)
expr2 j expr1 expr1 expr2 expr2 j expr1 c c c c MaxOp
expr1 expr1 expr1 expr2 expr1 expr1 c expr2 expr1 c expr1 expr2 expr1 expr2 expr1 expr1 expr1 expr1 j expr1 expr1 expr1 expr1 j expr1 c *expr2 expr1 c expr1 c expr1 c expr1 expr1 expr1 expr1 j *expr1 expr2 expr1 expr1 j *expr1 c expr2 expr1 c expr1 expr2 expr1 expr2 expr1 Atan2Op
KOKKOS_INLINE_FUNCTION PCE< Storage > ceil(const PCE< Storage > &a)
#define BINARYFUNC_MACRO(OP, FADOP)
KOKKOS_INLINE_FUNCTION PCE< Storage > max(const typename PCE< Storage >::value_type &a, const PCE< Storage > &b)
KOKKOS_INLINE_FUNCTION PCE< Storage > cosh(const PCE< Storage > &a)
KOKKOS_INLINE_FUNCTION PCE< Storage > abs(const PCE< Storage > &a)
KOKKOS_INLINE_FUNCTION PCE< Storage > atan(const PCE< Storage > &a)
KOKKOS_INLINE_FUNCTION PCE< Storage > exp(const PCE< Storage > &a)
expr2 j expr1 expr1 expr2 expr2 j expr1 c c c c MinOp
expr expr expr expr ExpOp
KOKKOS_INLINE_FUNCTION PCE< Storage > sin(const PCE< Storage > &a)
KOKKOS_INLINE_FUNCTION PCE< Storage > log(const PCE< Storage > &a)
KOKKOS_INLINE_FUNCTION PCE< Storage > log10(const PCE< Storage > &a)
KOKKOS_INLINE_FUNCTION PCE< Storage > asin(const PCE< Storage > &a)
KOKKOS_INLINE_FUNCTION PCE< Storage > cos(const PCE< Storage > &a)