|
Sacado Package Browser (Single Doxygen Collection) Version of the Day
|
00001 // @HEADER 00002 // *********************************************************************** 00003 // 00004 // Sacado Package 00005 // Copyright (2006) Sandia Corporation 00006 // 00007 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, 00008 // the U.S. Government retains certain rights in this software. 00009 // 00010 // This library is free software; you can redistribute it and/or modify 00011 // it under the terms of the GNU Lesser General Public License as 00012 // published by the Free Software Foundation; either version 2.1 of the 00013 // License, or (at your option) any later version. 00014 // 00015 // This library is distributed in the hope that it will be useful, but 00016 // WITHOUT ANY WARRANTY; without even the implied warranty of 00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00018 // Lesser General Public License for more details. 00019 // 00020 // You should have received a copy of the GNU Lesser General Public 00021 // License along with this library; if not, write to the Free Software 00022 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 00023 // USA 00024 // Questions? Contact David M. Gay (dmgay@sandia.gov) or Eric T. Phipps 00025 // (etphipp@sandia.gov). 00026 // 00027 // *********************************************************************** 00028 // @HEADER 00029 00030 #ifndef FAD_EXPR_FUNCS_HPP 00031 #define FAD_EXPR_FUNCS_HPP 00032 00033 #include "Sacado_MathFunctions.hpp" 00034 #include "Sacado_Fad_DFad.hpp" 00035 #include "Sacado_ELRFad_DFad.hpp" 00036 #include "Sacado_CacheFad_DFad.hpp" 00037 #include "Sacado_ELRCacheFad_DFad.hpp" 00038 #include "Sacado_Fad_SimpleFad.hpp" 00039 00040 #include "Sacado_ConfigDefs.h" 00041 00042 // ADOL-C includes 00043 #ifdef HAVE_ADOLC 00044 #ifdef PACKAGE 00045 #undef PACKAGE 00046 #endif 00047 #ifdef PACKAGE_NAME 00048 #undef PACKAGE_NAME 00049 #endif 00050 #ifdef PACKAGE_BUGREPORT 00051 #undef PACKAGE_BUGREPORT 00052 #endif 00053 #ifdef PACKAGE_STRING 00054 #undef PACKAGE_STRING 00055 #endif 00056 #ifdef PACKAGE_TARNAME 00057 #undef PACKAGE_TARNAME 00058 #endif 00059 #ifdef PACKAGE_VERSION 00060 #undef PACKAGE_VERSION 00061 #endif 00062 #ifdef VERSION 00063 #undef VERSION 00064 #endif 00065 //#define ADOLC_TAPELESS 00066 #define NUMBER_DIRECTIONS 100 00067 #include "adolc/adouble.h" 00068 #include "adolc/drivers/drivers.h" 00069 #include "adolc/interfaces.h" 00070 #endif 00071 00072 struct ExprFuncs { 00073 static const int nfunc = 8; 00074 static const char* mult_names[nfunc]; 00075 static const char* nest_names[nfunc]; 00076 static const char* add_names[nfunc]; 00077 static const int nx_max = 21; 00078 00079 template <typename T, int N> struct mult {}; 00080 template <typename T, int N> struct mult_base { static const int n = N+1; }; 00081 00082 template <typename T, int N> struct add {}; 00083 template <typename T, int N> struct add_base { static const int n = N+1; }; 00084 00085 template <typename T, int N> struct nest {}; 00086 template <typename T, int N> struct nest_base { static const int n = 1; }; 00087 }; 00088 00089 template <typename T> struct ExprFuncs::mult<T,1> : public mult_base<T,1> { 00090 void operator()(const T x[], T& y) const; }; 00091 template <typename T> struct ExprFuncs::mult<T,2> : public mult_base<T,2> { 00092 void operator()(const T x[], T& y) const; }; 00093 template <typename T> struct ExprFuncs::mult<T,3> : public mult_base<T,3> { 00094 void operator()(const T x[], T& y) const; }; 00095 template <typename T> struct ExprFuncs::mult<T,4> : public mult_base<T,4> { 00096 void operator()(const T x[], T& y) const; }; 00097 template <typename T> struct ExprFuncs::mult<T,5> : public mult_base<T,5> { 00098 void operator()(const T x[], T& y) const; }; 00099 template <typename T> struct ExprFuncs::mult<T,10> : public mult_base<T,10> { 00100 void operator()(const T x[], T& y) const; }; 00101 template <typename T> struct ExprFuncs::mult<T,15> : public mult_base<T,15> { 00102 void operator()(const T x[], T& y) const; }; 00103 template <typename T> struct ExprFuncs::mult<T,20> : public mult_base<T,20> { 00104 void operator()(const T x[], T& y) const; }; 00105 00106 template <typename T> struct ExprFuncs::add<T,1> : public add_base<T,1> { 00107 void operator()(const T x[], T& y) const; }; 00108 template <typename T> struct ExprFuncs::add<T,2> : public add_base<T,2> { 00109 void operator()(const T x[], T& y) const; }; 00110 template <typename T> struct ExprFuncs::add<T,3> : public add_base<T,3> { 00111 void operator()(const T x[], T& y) const; }; 00112 template <typename T> struct ExprFuncs::add<T,4> : public add_base<T,4> { 00113 void operator()(const T x[], T& y) const; }; 00114 template <typename T> struct ExprFuncs::add<T,5> : public add_base<T,5> { 00115 void operator()(const T x[], T& y) const; }; 00116 template <typename T> struct ExprFuncs::add<T,10> : public add_base<T,10> { 00117 void operator()(const T x[], T& y) const; }; 00118 template <typename T> struct ExprFuncs::add<T,15> : public add_base<T,15> { 00119 void operator()(const T x[], T& y) const; }; 00120 template <typename T> struct ExprFuncs::add<T,20> : public add_base<T,20> { 00121 void operator()(const T x[], T& y) const; }; 00122 00123 00124 template <typename T> struct ExprFuncs::nest<T,1> : public nest_base<T,1> { 00125 void operator()(const T x[], T& y) const; }; 00126 template <typename T> struct ExprFuncs::nest<T,2> : public nest_base<T,2> { 00127 void operator()(const T x[], T& y) const; }; 00128 template <typename T> struct ExprFuncs::nest<T,3> : public nest_base<T,3> { 00129 void operator()(const T x[], T& y) const; }; 00130 template <typename T> struct ExprFuncs::nest<T,4> : public nest_base<T,4> { 00131 void operator()(const T x[], T& y) const; }; 00132 template <typename T> struct ExprFuncs::nest<T,5> : public nest_base<T,5> { 00133 void operator()(const T x[], T& y) const; }; 00134 template <typename T> struct ExprFuncs::nest<T,10> : public nest_base<T,10> { 00135 void operator()(const T x[], T& y) const; }; 00136 template <typename T> struct ExprFuncs::nest<T,15> : public nest_base<T,15> { 00137 void operator()(const T x[], T& y) const; }; 00138 template <typename T> struct ExprFuncs::nest<T,20> : public nest_base<T,20> { 00139 void operator()(const T x[], T& y) const; }; 00140 00141 #endif
1.7.4