00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #ifndef SACADO_CACHEFAD_DFAD_HPP
00033 #define SACADO_CACHEFAD_DFAD_HPP
00034
00035 #include "Sacado_CacheFad_GeneralFadExpr.hpp"
00036 #include "Sacado_Fad_DynamicStorage.hpp"
00037 #include "Sacado_CacheFad_DFadTraits.hpp"
00038
00039 namespace Sacado {
00040
00041 namespace CacheFad {
00042
00068 template <typename ValueT,
00069 typename ScalarT = typename ScalarValueType<ValueT>::type >
00070 class DFad : public Expr< GeneralFad<ValueT,
00071 Fad::DynamicStorage<ValueT> > > {
00072
00073 public:
00074
00079
00081
00084 DFad() :
00085 Expr< GeneralFad< ValueT,Fad::DynamicStorage<ValueT> > >() {}
00086
00088
00091 DFad(const ValueT& x) :
00092 Expr< GeneralFad< ValueT,Fad::DynamicStorage<ValueT> > >(x) {}
00093
00095
00098 DFad(const ScalarT& x) :
00099 Expr< GeneralFad< ValueT,Fad::DynamicStorage<ValueT> > >(ValueT(x)) {}
00100
00102
00105 DFad(const int sz, const ValueT& x) :
00106 Expr< GeneralFad< ValueT,Fad::DynamicStorage<ValueT> > >(sz,x) {}
00107
00109
00114 DFad(const int sz, const int i, const ValueT & x) :
00115 Expr< GeneralFad< ValueT,Fad::DynamicStorage<ValueT> > >(sz,i,x) {}
00116
00118 DFad(const DFad& x) :
00119 Expr< GeneralFad< ValueT,Fad::DynamicStorage<ValueT> > >(x) {}
00120
00122 template <typename S> DFad(const Expr<S>& x) :
00123 Expr< GeneralFad< ValueT,Fad::DynamicStorage<ValueT> > >(x) {}
00124
00126
00128 ~DFad() {}
00129
00131 DFad& operator=(const ValueT& val) {
00132 GeneralFad< ValueT,Fad::DynamicStorage<ValueT> >::operator=(val);
00133 return *this;
00134 }
00135
00137 DFad& operator=(const ScalarT& val) {
00138 GeneralFad< ValueT,Fad::DynamicStorage<ValueT> >::operator=(ValueT(val));
00139 return *this;
00140 }
00141
00143 DFad& operator=(const DFad& x) {
00144 GeneralFad< ValueT,Fad::DynamicStorage<ValueT> >::operator=(static_cast<const GeneralFad< ValueT,Fad::DynamicStorage<ValueT> >&>(x));
00145 return *this;
00146 }
00147
00149 template <typename S> DFad& operator=(const Expr<S>& x)
00150 {
00151 GeneralFad< ValueT,Fad::DynamicStorage<ValueT> >::operator=(x);
00152 return *this;
00153 }
00154
00155 };
00156
00166 template <typename ValueT>
00167 class DFad<ValueT,ValueT> :
00168 public Expr< GeneralFad<ValueT,Fad::DynamicStorage<ValueT> > > {
00169
00170 public:
00171
00176
00178
00181 DFad() :
00182 Expr< GeneralFad< ValueT,Fad::DynamicStorage<ValueT> > >() {}
00183
00185
00188 DFad(const ValueT& x) :
00189 Expr< GeneralFad< ValueT,Fad::DynamicStorage<ValueT> > >(x) {}
00190
00192
00195 DFad(const int sz, const ValueT& x) :
00196 Expr< GeneralFad< ValueT,Fad::DynamicStorage<ValueT> > >(sz,x) {}
00197
00199
00204 DFad(const int sz, const int i, const ValueT& x) :
00205 Expr< GeneralFad< ValueT,Fad::DynamicStorage<ValueT> > >(sz,i,x) {}
00206
00208 DFad(const DFad& x) :
00209 Expr< GeneralFad< ValueT,Fad::DynamicStorage<ValueT> > >(x) {}
00210
00212 template <typename S> DFad(const Expr<S>& x) :
00213 Expr< GeneralFad< ValueT,Fad::DynamicStorage<ValueT> > >(x) {}
00214
00216
00218 ~DFad() {}
00219
00221 DFad& operator=(const ValueT& val) {
00222 GeneralFad< ValueT,Fad::DynamicStorage<ValueT> >::operator=(val);
00223 return *this;
00224 }
00225
00227 DFad& operator=(const DFad& x) {
00228 GeneralFad< ValueT,Fad::DynamicStorage<ValueT> >::operator=(static_cast<const GeneralFad< ValueT,Fad::DynamicStorage<ValueT> >&>(x));
00229 return *this;
00230 }
00231
00233 template <typename S> DFad& operator=(const Expr<S>& x)
00234 {
00235 GeneralFad< ValueT,Fad::DynamicStorage<ValueT> >::operator=(x);
00236 return *this;
00237 }
00238
00239 };
00240
00241 }
00242
00243 }
00244
00245 #endif // SACADO_CACHEFAD_DFAD_HPP