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_ELRFAD_SLFADTRAITS_HPP
00033 #define SACADO_ELRFAD_SLFADTRAITS_HPP
00034
00035 #include "Sacado_Traits.hpp"
00036
00037
00038 namespace Sacado {
00039 namespace ELRFad {
00040 template <typename T1, int Num, typename T2> class SLFad;
00041 }
00042 }
00043
00044 namespace Sacado {
00045
00047 template <typename ValueT, int Num, typename ScalarT>
00048 struct Promote< ELRFad::SLFad<ValueT,Num,ScalarT>,
00049 ELRFad::SLFad<ValueT,Num,ScalarT> > {
00050 typedef ELRFad::SLFad<ValueT,Num,ScalarT> type;
00051 };
00052
00054 template <typename ValueT, int Num, typename ScalarT, typename R>
00055 struct Promote< ELRFad::SLFad<ValueT,Num,ScalarT>, R > {
00056 typedef typename ValueType< ELRFad::SLFad<ValueT,Num,ScalarT> >::type value_type_l;
00057 typedef typename ValueType<R>::type value_type_r;
00058 typedef typename Promote<value_type_l,value_type_r>::type value_type;
00059
00060 typedef ELRFad::SLFad<value_type,Num,ScalarT> type;
00061 };
00062
00064 template <typename L, typename ValueT, int Num, typename ScalarT>
00065 struct Promote< L, ELRFad::SLFad<ValueT, Num, ScalarT> > {
00066 public:
00067
00068 typedef typename ValueType<L>::type value_type_l;
00069 typedef typename ValueType< ELRFad::SLFad<ValueT,Num,ScalarT> >::type value_type_r;
00070 typedef typename Promote<value_type_l,value_type_r>::type value_type;
00071
00072 typedef ELRFad::SLFad<value_type,Num,ScalarT> type;
00073 };
00074
00076 template <typename ValueT, int Num, typename ScalarT>
00077 struct ScalarType< ELRFad::SLFad<ValueT,Num,ScalarT> > {
00078 typedef ScalarT type;
00079 };
00080
00082 template <typename ValueT, int Num, typename ScalarT>
00083 struct ValueType< ELRFad::SLFad<ValueT,Num,ScalarT> > {
00084 typedef ValueT type;
00085 };
00086
00088 template <typename ValueT, int Num, typename ScalarT>
00089 struct ScalarValueType< ELRFad::SLFad<ValueT,Num,ScalarT> > {
00090 typedef typename ScalarValueType< ValueT >::type type;
00091 };
00092
00094 template <typename ValueT, int Num, typename ScalarT>
00095 struct IsADType< ELRFad::SLFad<ValueT,Num,ScalarT> > {
00096 static const bool value = true;
00097 };
00098
00100 template <typename ValueT, int Num, typename ScalarT>
00101 struct IsScalarType< ELRFad::SLFad<ValueT,Num,ScalarT> > {
00102 static const bool value = false;
00103 };
00104
00106 template <typename ValueT, int Num, typename ScalarT>
00107 struct Value< ELRFad::SLFad<ValueT,Num,ScalarT> > {
00108 typedef typename ValueType< ELRFad::SLFad<ValueT,Num,ScalarT> >::type value_type;
00109 static const value_type& eval(const ELRFad::SLFad<ValueT,Num,ScalarT>& x) {
00110 return x.val(); }
00111 };
00112
00113 }
00114
00115 #endif // SACADO_ELRFAD_SFADTRAITS_HPP