Sacado_Fad_SLFad.hpp

Go to the documentation of this file.
00001 // $Id: Sacado_Fad_SLFad.hpp,v 1.4 2007/04/26 21:49:12 etphipp Exp $ 
00002 // $Source: /space/CVS/Trilinos/packages/sacado/src/Sacado_Fad_SLFad.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_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     // Forward declaration
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     }; // class SLFad<ValueT,Num,ScalarT>
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     }; // class SLFad<ValueT,Num>
00238 
00239   } // namespace Fad
00240 
00241 } // namespace Sacado
00242 
00243 #endif // SACADO_FAD_SLFAD_HPP

Generated on Wed May 12 21:59:04 2010 for Sacado Package Browser (Single Doxygen Collection) by  doxygen 1.4.7