Stokhos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Sacado_PCE_OrthogPolyTraits.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Stokhos Package
4 //
5 // Copyright 2009 NTESS and the Stokhos contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef SACADO_PCE_ORTHOGPOLYTRAITS_HPP
11 #define SACADO_PCE_ORTHOGPOLYTRAITS_HPP
12 
13 #include "Sacado_Traits.hpp"
14 
15 // Forward declarations
16 namespace Sacado {
17  namespace PCE {
18  template <typename T, typename S> class OrthogPoly;
19  }
20 }
21 
22 namespace Sacado {
23 
25  SACADO_AD_PROMOTE_SPEC2( PCE, OrthogPoly )
26 
27 
28  template <typename T, typename S>
29  struct ScalarType< PCE::OrthogPoly<T,S> > {
31  };
32 
34  template <typename T, typename S>
35  struct ValueType< PCE::OrthogPoly<T,S> > {
37  };
38 
40  template <typename T, typename S>
41  struct IsADType< PCE::OrthogPoly<T,S> > {
42  static const bool value = true;
43  };
44 
46  template <typename T, typename S>
47  struct IsScalarType< PCE::OrthogPoly<T,S> > {
48  static const bool value = false;
49  };
50 
52  template <typename T, typename S>
53  struct Value< PCE::OrthogPoly<T,S> > {
54  typedef typename ValueType< PCE::OrthogPoly<T,S> >::type value_type;
55  static const value_type& eval(const PCE::OrthogPoly<T,S>& x) {
56  return x.val(); }
57  };
58 
60  template <typename T, typename S>
61  struct ScalarValue< PCE::OrthogPoly<T,S> > {
62  typedef typename ValueType< PCE::OrthogPoly<T,S> >::type value_type;
63  typedef typename ScalarType< PCE::OrthogPoly<T,S> >::type scalar_type;
64  static const scalar_type& eval(const PCE::OrthogPoly<T,S>& x) {
65  return ScalarValue<value_type>::eval(x.val()); }
66  };
67 
69  template <typename T, typename S>
70  struct StringName< PCE::OrthogPoly<T,S> > {
71  static std::string eval() {
72  return std::string("Sacado::PCE::OrthogPoly< ") +
73  StringName<T>::eval() + " >"; }
74  };
75 
77  template <typename T, typename S>
78  struct IsEqual< PCE::OrthogPoly<T,S> > {
79  static bool eval(const PCE::OrthogPoly<T,S>& x,
80  const PCE::OrthogPoly<T,S>& y) {
81  return x.isEqualTo(y);
82  }
83  };
84 
86  template <typename T, typename S>
87  struct IsStaticallySized< PCE::OrthogPoly<T,S> > {
88  static const bool value = false;
89  };
90 
91 } // namespace Sacado
92 
93 // Define Teuchos traits classes
94 // Note Stokhos has required dependency on all Teuchos sub-packages
96 #include "Teuchos_ScalarTraits.hpp"
99 
100 namespace Teuchos {
101 
103  template <typename T, typename S>
104  struct PromotionTraits< Sacado::PCE::OrthogPoly<T,S>,
105  Sacado::PCE::OrthogPoly<T,S> > {
106  typedef typename Sacado::Promote< Sacado::PCE::OrthogPoly<T,S>,
109  };
110 
112  template <typename T, typename S, typename R>
113  struct PromotionTraits< Sacado::PCE::OrthogPoly<T,S>, R > {
114  typedef typename Sacado::Promote< Sacado::PCE::OrthogPoly<T,S>, R >::type
116  };
117 
119  template <typename L, typename T, typename S>
120  struct PromotionTraits< L, Sacado::PCE::OrthogPoly<T,S> > {
121  public:
122  typedef typename Sacado::Promote< L, Sacado::PCE::OrthogPoly<T,S> >::type
124  };
125 
127  template <typename T, typename S>
128  struct ScalarTraits< Sacado::PCE::OrthogPoly<T,S> > :
129  public Sacado::PCE::ScalarTraitsImp< Sacado::PCE::OrthogPoly<T,S> > {};
130 
132  template <typename TypeTo, typename T, typename S>
133  struct ValueTypeConversionTraits< TypeTo, Sacado::PCE::OrthogPoly<T,S> > :
135  Sacado::PCE::OrthogPoly<T,S> > {};
136 
138  template <typename Ordinal, typename T, typename S>
139  struct SerializationTraits<Ordinal, Sacado::PCE::OrthogPoly<T,S> > :
140  public Sacado::PCE::SerializationTraitsImp< Ordinal,
141  Sacado::PCE::OrthogPoly<T,S> >
142  {};
143 
145  template <typename Ordinal, typename T, typename S>
146  struct ValueTypeSerializer<Ordinal, Sacado::PCE::OrthogPoly<T,S> > :
147  public Sacado::PCE::SerializerImp< Ordinal,
148  Sacado::PCE::OrthogPoly<T,S>,
149  ValueTypeSerializer<Ordinal,T> >
150  {
157  Base(expansion,vs) {}
158  };
159 
160 }
161 
162 #endif // SACADO_PCE_UNIVARIATEHERMITETRAITS_HPP
ValueTypeSerializer(const Teuchos::RCP< expansion_type > &expansion, const Teuchos::RCP< const ValueSerializer > &vs)
Implementation for Teuchos::ScalarTraits for all PCE types.
PCEType::expansion_type expansion_type
Typename of expansion.
Serializer object for all PCE types.
ScalarType< typename PCE::OrthogPoly< T, S >::value_type >::type type
ValueType< PCE::OrthogPoly< T, S > >::type value_type
static bool eval(const PCE::OrthogPoly< T, S > &x, const PCE::OrthogPoly< T, S > &y)
Sacado::Promote< L, Sacado::PCE::OrthogPoly< T, S > >::type promote
ValueType< PCE::OrthogPoly< T, S > >::type value_type
static const value_type & eval(const PCE::OrthogPoly< T, S > &x)
ScalarType< PCE::OrthogPoly< T, S > >::type scalar_type
Sacado::Promote< Sacado::PCE::OrthogPoly< T, S >, R >::type promote
Implementation for Teuchos::ValueTypeConversionTraits for all PCE types.
Implementation of Teuchos::SerializationTraits for all PCE types.
Sacado::Promote< Sacado::PCE::OrthogPoly< T, S >, Sacado::PCE::OrthogPoly< T, S > >::type promote
Sacado::PCE::SerializerImp< Ordinal, PCEType, ValueSerializer > Base
static const scalar_type & eval(const PCE::OrthogPoly< T, S > &x)