Sacado_CacheFad_DFad.hpp

Go to the documentation of this file.
00001 // $Id: Sacado_CacheFad_DFad.hpp,v 1.5 2007/04/26 21:49:12 etphipp Exp $ 
00002 // $Source: /space/CVS/Trilinos/packages/sacado/src/Sacado_CacheFad_DFad.hpp,v $ 
00003 // @HEADER
00004 // ***********************************************************************
00005 // 
00006 //                           Sacado Package
00007 //                 Copyright (2006) Sandia Corporation
00008 // 
00009 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
00010 // the U.S. Government retains certain rights in this software.
00011 // 
00012 // This library is free software; you can redistribute it and/or modify
00013 // it under the terms of the GNU Lesser General Public License as
00014 // published by the Free Software Foundation; either version 2.1 of the
00015 // License, or (at your option) any later version.
00016 //  
00017 // This library is distributed in the hope that it will be useful, but
00018 // WITHOUT ANY WARRANTY; without even the implied warranty of
00019 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00020 // Lesser General Public License for more details.
00021 //  
00022 // You should have received a copy of the GNU Lesser General Public
00023 // License along with this library; if not, write to the Free Software
00024 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00025 // USA
00026 // Questions? Contact David M. Gay (dmgay@sandia.gov) or Eric T. Phipps
00027 // (etphipp@sandia.gov).
00028 // 
00029 // ***********************************************************************
00030 // @HEADER
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     }; // class DFad<ScalarT,ValueT>
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     }; // class DFad<ValueT>
00240 
00241   } // namespace CacheFad
00242 
00243 } // namespace Sacado
00244 
00245 #endif // SACADO_CACHEFAD_DFAD_HPP

Generated on Tue Oct 20 12:55:04 2009 for Sacado Package Browser (Single Doxygen Collection) by doxygen 1.4.7