Sacado Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
fad_expr_funcs.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 FAD_EXPR_FUNCS_HPP
31 #define FAD_EXPR_FUNCS_HPP
32 
33 #include "Sacado.hpp"
34 #include "Sacado_Fad_SimpleFad.hpp"
35 
36 // ADOL-C includes
37 #ifdef HAVE_ADOLC
38 #ifdef PACKAGE
39 #undef PACKAGE
40 #endif
41 #ifdef PACKAGE_NAME
42 #undef PACKAGE_NAME
43 #endif
44 #ifdef PACKAGE_BUGREPORT
45 #undef PACKAGE_BUGREPORT
46 #endif
47 #ifdef PACKAGE_STRING
48 #undef PACKAGE_STRING
49 #endif
50 #ifdef PACKAGE_TARNAME
51 #undef PACKAGE_TARNAME
52 #endif
53 #ifdef PACKAGE_VERSION
54 #undef PACKAGE_VERSION
55 #endif
56 #ifdef VERSION
57 #undef VERSION
58 #endif
59 //#define ADOLC_TAPELESS
60 #define NUMBER_DIRECTIONS 100
61 #include "adolc/adouble.h"
62 #include "adolc/drivers/drivers.h"
63 #include "adolc/interfaces.h"
64 #endif
65 
66 struct ExprFuncs {
67  static const int nfunc = 8;
68  static const char* mult_names[nfunc];
69  static const char* nest_names[nfunc];
70  static const char* add_names[nfunc];
71  static const int nx_max = 21;
72 
73  template <typename T, int N> struct mult {};
74  template <typename T, int N> struct mult_base { static const int n = N+1; };
75 
76  template <typename T, int N> struct add {};
77  template <typename T, int N> struct add_base { static const int n = N+1; };
78 
79  template <typename T, int N> struct nest {};
80  template <typename T, int N> struct nest_base { static const int n = 1; };
81 };
82 
83 template <typename T> struct ExprFuncs::mult<T,1> : public mult_base<T,1> {
84  void operator()(const T x[], T& y) const; };
85 template <typename T> struct ExprFuncs::mult<T,2> : public mult_base<T,2> {
86  void operator()(const T x[], T& y) const; };
87 template <typename T> struct ExprFuncs::mult<T,3> : public mult_base<T,3> {
88  void operator()(const T x[], T& y) const; };
89 template <typename T> struct ExprFuncs::mult<T,4> : public mult_base<T,4> {
90  void operator()(const T x[], T& y) const; };
91 template <typename T> struct ExprFuncs::mult<T,5> : public mult_base<T,5> {
92  void operator()(const T x[], T& y) const; };
93 template <typename T> struct ExprFuncs::mult<T,10> : public mult_base<T,10> {
94  void operator()(const T x[], T& y) const; };
95 template <typename T> struct ExprFuncs::mult<T,15> : public mult_base<T,15> {
96  void operator()(const T x[], T& y) const; };
97 template <typename T> struct ExprFuncs::mult<T,20> : public mult_base<T,20> {
98  void operator()(const T x[], T& y) const; };
99 
100 template <typename T> struct ExprFuncs::add<T,1> : public add_base<T,1> {
101  void operator()(const T x[], T& y) const; };
102 template <typename T> struct ExprFuncs::add<T,2> : public add_base<T,2> {
103  void operator()(const T x[], T& y) const; };
104 template <typename T> struct ExprFuncs::add<T,3> : public add_base<T,3> {
105  void operator()(const T x[], T& y) const; };
106 template <typename T> struct ExprFuncs::add<T,4> : public add_base<T,4> {
107  void operator()(const T x[], T& y) const; };
108 template <typename T> struct ExprFuncs::add<T,5> : public add_base<T,5> {
109  void operator()(const T x[], T& y) const; };
110 template <typename T> struct ExprFuncs::add<T,10> : public add_base<T,10> {
111  void operator()(const T x[], T& y) const; };
112 template <typename T> struct ExprFuncs::add<T,15> : public add_base<T,15> {
113  void operator()(const T x[], T& y) const; };
114 template <typename T> struct ExprFuncs::add<T,20> : public add_base<T,20> {
115  void operator()(const T x[], T& y) const; };
116 
117 
118 template <typename T> struct ExprFuncs::nest<T,1> : public nest_base<T,1> {
119  void operator()(const T x[], T& y) const; };
120 template <typename T> struct ExprFuncs::nest<T,2> : public nest_base<T,2> {
121  void operator()(const T x[], T& y) const; };
122 template <typename T> struct ExprFuncs::nest<T,3> : public nest_base<T,3> {
123  void operator()(const T x[], T& y) const; };
124 template <typename T> struct ExprFuncs::nest<T,4> : public nest_base<T,4> {
125  void operator()(const T x[], T& y) const; };
126 template <typename T> struct ExprFuncs::nest<T,5> : public nest_base<T,5> {
127  void operator()(const T x[], T& y) const; };
128 template <typename T> struct ExprFuncs::nest<T,10> : public nest_base<T,10> {
129  void operator()(const T x[], T& y) const; };
130 template <typename T> struct ExprFuncs::nest<T,15> : public nest_base<T,15> {
131  void operator()(const T x[], T& y) const; };
132 template <typename T> struct ExprFuncs::nest<T,20> : public nest_base<T,20> {
133  void operator()(const T x[], T& y) const; };
134 
135 #endif
static const int nx_max
#define T
Definition: Sacado_rad.hpp:573
static const char * mult_names[nfunc]
static const int n
static const char * add_names[nfunc]
const int N
static const int n
static const int nfunc
static const int n
static const char * nest_names[nfunc]