Debian Codegraph @

packages/stokhos/src/sacado/Stokhos_Sacado_MathFunctions.hpp

raw
1 // @HEADER
2 // *****************************************************************************
3 // Stokhos Package
4 //
5 // Copyright 2009 NTESS and the Stokhos contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9
10 #ifndef STOKHOS_SACADO_MATH_FUNCTIONS_HPP
11 #define STOKHOS_SACADO_MATH_FUNCTIONS_HPP
12
13 #define UNARYFUNC_MACRO(OP,FADOP) \
14 namespace Sacado { \
15 \
16 namespace PCE { \
17 template <typename T, typename S> class OrthogPoly; \
18 template <typename T, typename S> \
19 OrthogPoly<T,S> OP (const OrthogPoly<T,S>&); \
20 } \
21 \
22 namespace ETPCE { \
23 template <typename T> class FADOP; \
24 template <typename T> class Expr; \
25 template <typename T> \
26 Expr< FADOP< Expr<T> > > OP (const Expr<T>&); \
27 } \
28 \
29 } \
30 \
31 namespace std { \
32 using Sacado::PCE::OP; \
33 using Sacado::ETPCE::OP; \
34 }
35
36 UNARYFUNC_MACRO(exp, ExpOp)
37 UNARYFUNC_MACRO(log, LogOp)
38 UNARYFUNC_MACRO(log10, Log10Op)
39 UNARYFUNC_MACRO(sqrt, SqrtOp)
40 UNARYFUNC_MACRO(cbrt, CbrtOp)
41 UNARYFUNC_MACRO(cos, CosOp)
42 UNARYFUNC_MACRO(sin, SinOp)
43 UNARYFUNC_MACRO(tan, TanOp)
44 UNARYFUNC_MACRO(acos, ACosOp)
45 UNARYFUNC_MACRO(asin, ASinOp)
46 UNARYFUNC_MACRO(atan, ATanOp)
47 UNARYFUNC_MACRO(cosh, CoshOp)
48 UNARYFUNC_MACRO(sinh, SinhOp)
49 UNARYFUNC_MACRO(tanh, TanhOp)
50 UNARYFUNC_MACRO(acosh, ACoshOp)
51 UNARYFUNC_MACRO(asinh, ASinhOp)
52 UNARYFUNC_MACRO(atanh, ATanhOp)
53 UNARYFUNC_MACRO(abs, AbsOp)
54 UNARYFUNC_MACRO(fabs, FAbsOp)
55
56 #undef UNARYFUNC_MACRO
57
58 #define BINARYFUNC_MACRO(OP,FADOP) \
59 namespace Sacado { \
60 \
61 namespace PCE { \
62 template <typename T, typename S> class OrthogPoly; \
63 template <typename T, typename S> \
64 OrthogPoly<T,S> OP (const OrthogPoly<T,S>&, \
65 const OrthogPoly<T,S>&); \
66 template <typename T, typename S> \
67 OrthogPoly<T,S> OP (const T&, \
68 const OrthogPoly<T,S>&); \
69 template <typename T, typename S> \
70 OrthogPoly<T,S> OP (const OrthogPoly<T,S>&, \
71 const T&); \
72 } \
73 \
74 namespace ETPCE { \
75 template <typename T1, typename T2> class FADOP; \
76 template <typename T> class Expr; \
77 template <typename T> class ConstExpr; \
78 template <typename T1, typename T2> \
79 Expr< FADOP< Expr<T1>, Expr<T2> > > \
80 OP (const Expr<T1>&, const Expr<T2>&); \
81 \
82 template <typename T> \
83 Expr< FADOP< Expr<T>, Expr<T> > > \
84 OP (const Expr<T>&, const Expr<T>&); \
85 \
86 template <typename T> \
87 Expr< FADOP< typename Expr<T>::value_type, Expr<T> > > \
88 OP (const typename Expr<T>::value_type&, const Expr<T>&); \
89 \
90 template <typename T> \
91 Expr< FADOP< Expr<T>, typename Expr<T>::value_type > > \
92 OP (const Expr<T>&, const typename Expr<T>::value_type&); \
93 } \
94 \
95 } \
96 \
97 namespace std { \
98 using Sacado::PCE::OP; \
99 using Sacado::ETPCE::OP; \
100 }
101
102 BINARYFUNC_MACRO(atan2, Atan2Op)
103 BINARYFUNC_MACRO(pow, PowerOp)
104 BINARYFUNC_MACRO(max, MaxOp)
105 BINARYFUNC_MACRO(min, MinOp)
106
107 #undef BINARYFUNC_MACRO
108
109 #endif // STOKHOS_SACADO_MATH_FUNCTIONS_HPP