|
Sacado Package Browser (Single Doxygen Collection) Version of the Day
|
00001 // $Id$ 00002 // $Source$ 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_DVFAD_HPP 00033 #define SACADO_FAD_DVFAD_HPP 00034 00035 #include "Sacado_Fad_GeneralFadExpr.hpp" 00036 #include "Sacado_Fad_DVFadTraits.hpp" 00037 #include "Sacado_Fad_VectorDynamicStorage.hpp" 00038 #include "Sacado_dummy_arg.hpp" 00039 00040 namespace Sacado { 00041 00042 namespace Fad { 00043 00054 template <typename ValueT> 00055 class DVFad : 00056 public Expr< GeneralFad<ValueT,VectorDynamicStorage<ValueT> > > { 00057 00058 public: 00059 00061 typedef typename ScalarType<ValueT>::type ScalarT; 00062 00064 template <typename T> 00065 struct apply { 00066 typedef DVFad<T> type; 00067 }; 00068 00073 00075 00078 DVFad() : 00079 Expr< GeneralFad< ValueT,VectorDynamicStorage<ValueT> > >() {} 00080 00082 00085 DVFad(const ValueT& x) : 00086 Expr< GeneralFad< ValueT,VectorDynamicStorage<ValueT> > >(x) {} 00087 00089 00093 DVFad(const typename dummy<ValueT,ScalarT>::type& x) : 00094 Expr< GeneralFad< ValueT,VectorDynamicStorage<ValueT> > >(ValueT(x)) {} 00095 00097 00100 DVFad(const int sz, const ValueT& x) : 00101 Expr< GeneralFad< ValueT,VectorDynamicStorage<ValueT> > >(sz,x) {} 00102 00104 00109 DVFad(const int sz, const int i, const ValueT & x) : 00110 Expr< GeneralFad< ValueT,VectorDynamicStorage<ValueT> > >(sz,i,x) {} 00111 00113 00117 DVFad(const int sz, ValueT* x, ValueT* dx, bool zero_out = false) : 00118 Expr< GeneralFad< ValueT,VectorDynamicStorage<ValueT> > >(sz,x,dx,zero_out) {} 00119 00121 00126 DVFad(const int sz, const int i, ValueT* x, ValueT* dx) : 00127 Expr< GeneralFad< ValueT,VectorDynamicStorage<ValueT> > >(sz,i,x,dx) {} 00128 00130 DVFad(const DVFad& x) : 00131 Expr< GeneralFad< ValueT,VectorDynamicStorage<ValueT> > >(x) {} 00132 00134 template <typename S> DVFad(const Expr<S>& x) : 00135 Expr< GeneralFad< ValueT,VectorDynamicStorage<ValueT> > >(x) {} 00136 00138 00140 ~DVFad() {} 00141 00143 DVFad& operator=(const ValueT& v) { 00144 GeneralFad< ValueT,VectorDynamicStorage<ValueT> >::operator=(v); 00145 return *this; 00146 } 00147 00149 00152 DVFad& operator=(const typename dummy<ValueT,ScalarT>::type& v) { 00153 GeneralFad< ValueT,VectorDynamicStorage<ValueT> >::operator=(ValueT(v)); 00154 return *this; 00155 } 00156 00158 DVFad& operator=(const DVFad& x) { 00159 GeneralFad< ValueT,VectorDynamicStorage<ValueT> >::operator=(static_cast<const GeneralFad< ValueT,VectorDynamicStorage<ValueT> >&>(x)); 00160 return *this; 00161 } 00162 00164 template <typename S> DVFad& operator=(const Expr<S>& x) 00165 { 00166 GeneralFad< ValueT,VectorDynamicStorage<ValueT> >::operator=(x); 00167 return *this; 00168 } 00169 00170 }; // class DVFad<ValueT> 00171 00172 } // namespace Fad 00173 00174 } // namespace Sacado 00175 00176 #endif // SACADO_FAD_DFAD_HPP
1.7.4