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_FAD_SLFAD_HPP
00033 #define SACADO_FAD_SLFAD_HPP
00034
00035 #include "Sacado_Fad_GeneralFadExpr.hpp"
00036 #include "Sacado_Fad_StaticStorage.hpp"
00037 #include "Sacado_Fad_SLFadTraits.hpp"
00038
00039 namespace Sacado {
00040
00041 namespace Fad {
00042
00043
00044 template <typename T, int Num>
00045 class StaticStorage;
00046
00070 template <typename ValueT, int Num,
00071 typename ScalarT = typename ScalarValueType<ValueT>::type >
00072 class SLFad :
00073 public Expr< GeneralFad<ValueT,StaticStorage<ValueT,Num> > > {
00074
00075 public:
00076
00081
00083
00086 SLFad() :
00087 Expr< GeneralFad< ValueT,StaticStorage<ValueT,Num> > >() {}
00088
00090
00093 SLFad(const ValueT & x) :
00094 Expr< GeneralFad< ValueT,StaticStorage<ValueT,Num> > >(x) {}
00095
00097
00100 SLFad(const ScalarT& x) :
00101 Expr< GeneralFad< ValueT,StaticStorage<ValueT,Num> > >(ValueT(x)) {}
00102
00104
00107 SLFad(const int sz, const ValueT & x) :
00108 Expr< GeneralFad< ValueT,StaticStorage<ValueT,Num> > >(sz,x) {}
00109
00111
00116 SLFad(const int sz, const int i, const ValueT & x) :
00117 Expr< GeneralFad< ValueT,StaticStorage<ValueT,Num> > >(sz,i,x) {}
00118
00120 SLFad(const SLFad& x) :
00121 Expr< GeneralFad< ValueT,StaticStorage<ValueT,Num> > >(x) {}
00122
00124 template <typename S> SLFad(const Expr<S>& x) :
00125 Expr< GeneralFad< ValueT,StaticStorage<ValueT,Num> > >(x) {}
00126
00128
00130 ~SLFad() {}
00131
00133 SLFad& operator=(const ValueT& val) {
00134 GeneralFad< ValueT,StaticStorage<ValueT,Num> >::operator=(val);
00135 return *this;
00136 }
00137
00139 SLFad& operator=(const ScalarT& val) {
00140 GeneralFad< ValueT,StaticStorage<ValueT,Num> >::operator=(ValueT(val));
00141 return *this;
00142 }
00143
00145 SLFad& operator=(const SLFad& x) {
00146 GeneralFad< ValueT,StaticStorage<ValueT,Num> >::operator=(static_cast<const GeneralFad< ValueT,StaticStorage<ValueT,Num> >&>(x));
00147 return *this;
00148 }
00149
00151 template <typename S> SLFad& operator=(const Expr<S>& x)
00152 {
00153 GeneralFad< ValueT,StaticStorage<ValueT,Num> >::operator=(x);
00154 return *this;
00155 }
00156
00157 };
00158
00160
00165 template <typename ValueT, int Num>
00166 class SLFad<ValueT,Num,ValueT> :
00167 public Expr< GeneralFad<ValueT,StaticStorage<ValueT,Num> > >{
00168
00169 public:
00170
00175
00177
00180 SLFad() : Expr< GeneralFad< ValueT,StaticStorage<ValueT,Num> > >() {}
00181
00183
00186 SLFad(const ValueT & x) :
00187 Expr< GeneralFad< ValueT,StaticStorage<ValueT,Num> > >(x) {}
00188
00190
00193 SLFad(const int sz, const ValueT & x) :
00194 Expr< GeneralFad< ValueT,StaticStorage<ValueT,Num> > >(sz,x) {}
00195
00197
00202 SLFad(const int sz, const int i, const ValueT & x) :
00203 Expr< GeneralFad< ValueT,StaticStorage<ValueT,Num> > >(sz,i,x) {}
00204
00206 SLFad(const SLFad& x) :
00207 Expr< GeneralFad< ValueT,StaticStorage<ValueT,Num> > >(x) {}
00208
00210 template <typename S> SLFad(const Expr<S>& x) :
00211 Expr< GeneralFad< ValueT,StaticStorage<ValueT,Num> > >(x) {}
00212
00214
00216 ~SLFad() {}
00217
00219 SLFad& operator=(const ValueT& val) {
00220 GeneralFad< ValueT,StaticStorage<ValueT,Num> >::operator=(val);
00221 return *this;
00222 }
00223
00225 SLFad& operator=(const SLFad& x) {
00226 GeneralFad< ValueT,StaticStorage<ValueT,Num> >::operator=(static_cast<const GeneralFad< ValueT,StaticStorage<ValueT,Num> >&>(x));
00227 return *this;
00228 }
00229
00231 template <typename S> SLFad& operator=(const Expr<S>& x)
00232 {
00233 GeneralFad< ValueT,StaticStorage<ValueT,Num> >::operator=(x);
00234 return *this;
00235 }
00236
00237 };
00238
00239 }
00240
00241 }
00242
00243 #endif // SACADO_FAD_SLFAD_HPP