Stokhos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Sacado_ETPCE_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_ETPCE_ORTHOGPOLYTRAITS_HPP
11 #define SACADO_ETPCE_ORTHOGPOLYTRAITS_HPP
12 
13 #include "Sacado_Traits.hpp"
14 
15 // Forward declarations
16 namespace Sacado {
17  namespace ETPCE {
18  template <typename T, typename S> class OrthogPoly;
19  }
20 }
21 
22 namespace Sacado {
23 
25  SACADO_AD_PROMOTE_SPEC2( ETPCE, OrthogPoly )
26 
27 
28  template <typename T, typename S>
29  struct ScalarType< ETPCE::OrthogPoly<T,S> > {
31  };
32 
34  template <typename T, typename S>
35  struct ValueType< ETPCE::OrthogPoly<T,S> > {
37  };
38 
40  template <typename T, typename S>
41  struct IsADType< ETPCE::OrthogPoly<T,S> > {
42  static const bool value = true;
43  };
44 
46  template <typename T, typename S>
47  struct IsScalarType< ETPCE::OrthogPoly<T,S> > {
48  static const bool value = false;
49  };
50 
52  template <typename T, typename S>
53  struct Value< ETPCE::OrthogPoly<T,S> > {
54  typedef typename ValueType< ETPCE::OrthogPoly<T,S> >::type value_type;
55  static const value_type& eval(const ETPCE::OrthogPoly<T,S>& x) {
56  return x.val(); }
57  };
58 
60  template <typename T, typename S>
61  struct ScalarValue< ETPCE::OrthogPoly<T,S> > {
62  typedef typename ValueType< ETPCE::OrthogPoly<T,S> >::type value_type;
63  typedef typename ScalarType< ETPCE::OrthogPoly<T,S> >::type scalar_type;
64  static const scalar_type& eval(const ETPCE::OrthogPoly<T,S>& x) {
65  return ScalarValue<value_type>::eval(x.val()); }
66  };
67 
69  template <typename T, typename S>
70  struct StringName< ETPCE::OrthogPoly<T,S> > {
71  static std::string eval() {
72  return std::string("Sacado::ETPCE::OrthogPoly< ") +
73  StringName<T>::eval() + " >"; }
74  };
75 
77  template <typename T, typename S>
78  struct IsEqual< ETPCE::OrthogPoly<T,S> > {
79  static bool eval(const ETPCE::OrthogPoly<T,S>& x,
80  const ETPCE::OrthogPoly<T,S>& y) {
81  return x.isEqualTo(y);
82  }
83  };
84 
86  template <typename T, typename S>
87  struct IsStaticallySized< ETPCE::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::ETPCE::OrthogPoly<T,S>,
106  typedef typename Sacado::Promote< Sacado::ETPCE::OrthogPoly<T,S>,
109  };
110 
112  template <typename T, typename S, typename R>
113  struct PromotionTraits< Sacado::ETPCE::OrthogPoly<T,S>, R > {
114  typedef typename Sacado::Promote< Sacado::ETPCE::OrthogPoly<T,S>, R >::type
116  };
117 
119  template <typename L, typename T, typename S>
120  struct PromotionTraits< L, Sacado::ETPCE::OrthogPoly<T,S> > {
121  public:
122  typedef typename Sacado::Promote< L, Sacado::ETPCE::OrthogPoly<T,S> >::type
124  };
125 
127  template <typename T, typename S>
128  struct ScalarTraits< Sacado::ETPCE::OrthogPoly<T,S> > :
129  public Sacado::PCE::ScalarTraitsImp< Sacado::ETPCE::OrthogPoly<T,S> > {};
130 
132  template <typename Ordinal, typename T, typename S>
133  struct SerializationTraits<Ordinal, Sacado::ETPCE::OrthogPoly<T,S> > :
134  public Sacado::PCE::SerializationTraitsImp< Ordinal,
135  Sacado::ETPCE::OrthogPoly<T,S> >
136  {};
137 
139  template <typename Ordinal, typename T, typename S>
140  struct ValueTypeSerializer<Ordinal, Sacado::ETPCE::OrthogPoly<T,S> > :
141  public Sacado::PCE::SerializerImp< Ordinal,
142  Sacado::ETPCE::OrthogPoly<T,S>,
143  ValueTypeSerializer<Ordinal,T> >
144  {
151  Base(expansion,vs) {}
152  };
153 }
154 
155 #endif // SACADO_ETPCE_ORTHOGPOLYTRAITS_HPP
ValueType< ETPCE::OrthogPoly< T, S > >::type value_type
Sacado::Promote< Sacado::ETPCE::OrthogPoly< T, S >, Sacado::ETPCE::OrthogPoly< T, S > >::type promote
ValueTypeSerializer(const Teuchos::RCP< expansion_type > &expansion, const Teuchos::RCP< const ValueSerializer > &vs)
ValueType< ETPCE::OrthogPoly< T, S > >::type value_type
Implementation for Teuchos::ScalarTraits for all PCE types.
PCEType::expansion_type expansion_type
Typename of expansion.
Serializer object for all PCE types.
ScalarType< typename ETPCE::OrthogPoly< T, S >::value_type >::type type
Sacado::Promote< L, Sacado::ETPCE::OrthogPoly< T, S > >::type promote
static bool eval(const ETPCE::OrthogPoly< T, S > &x, const ETPCE::OrthogPoly< T, S > &y)
Sacado::Promote< Sacado::ETPCE::OrthogPoly< T, S >, R >::type promote
static const value_type & eval(const ETPCE::OrthogPoly< T, S > &x)
static const scalar_type & eval(const ETPCE::OrthogPoly< T, S > &x)
Implementation of Teuchos::SerializationTraits for all PCE types.
Sacado::PCE::SerializerImp< Ordinal, PCEType, ValueSerializer > Base
ScalarType< ETPCE::OrthogPoly< T, S > >::type scalar_type