Sacado Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Sacado_ELRFad_ExpressionTraits.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Sacado Package
4 //
5 // Copyright 2006 NTESS and the Sacado contributors.
6 // SPDX-License-Identifier: LGPL-2.1-or-later
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef SACADO_ELRFAD_EXPRESSIONTRAITS_HPP
11 #define SACADO_ELRFAD_EXPRESSIONTRAITS_HPP
12 
13 #include "Sacado_Traits.hpp"
14 
15 // Forward declarations
16 namespace Sacado {
17  namespace ELRFad {
18  template <typename T> class Expr;
19  }
20 }
21 
22 namespace Sacado {
23 
25  SACADO_EXPR_PROMOTE_SPEC( ELRFad )
26 
27 
28  template <typename T>
29  struct ScalarType< ELRFad::Expr<T> > {
31  };
32 
34  template <typename T>
35  struct ValueType< ELRFad::Expr<T> > {
37  };
38 
40  template <typename T>
41  struct IsADType< ELRFad::Expr<T> > {
42  static const bool value = true;
43  };
44 
46  template <typename T>
47  struct IsScalarType< ELRFad::Expr<T> > {
48  static const bool value = false;
49  };
50 
52  template <typename T>
53  struct Value< ELRFad::Expr<T> > {
54  typedef typename ValueType< ELRFad::Expr<T> >::type value_type;
56  static const value_type& eval(const ELRFad::Expr<T>& x) {
57  return x.val(); }
58  };
59 
61  template <typename T>
62  struct ScalarValue< ELRFad::Expr<T> > {
63  typedef typename ValueType< ELRFad::Expr<T> >::type value_type;
64  typedef typename ScalarType< ELRFad::Expr<T> >::type scalar_type;
66  static const scalar_type& eval(const ELRFad::Expr<T>& x) {
67  return ScalarValue<value_type>::eval(x.val()); }
68  };
69 
70 } // namespace Sacado
71 
72 #endif // SACADO_ELRFAD_EXPRESSIONTRAITS_HPP
static SACADO_INLINE_FUNCTION const T & eval(const T &x)
ValueType< ELRFad::Expr< T > >::type value_type
Base template specification for ScalarValue.
Base template specification for ScalarType.
static SACADO_INLINE_FUNCTION const scalar_type & eval(const ELRFad::Expr< T > &x)
ScalarType< ELRFad::Expr< T > >::type scalar_type
Base template specification for IsADType.
static SACADO_INLINE_FUNCTION const value_type & eval(const ELRFad::Expr< T > &x)
Base template specification for Value.
#define T
Definition: Sacado_rad.hpp:553
static const bool value
#define SACADO_EXPR_PROMOTE_SPEC(NS)
ScalarType< typename ELRFad::Expr< T >::value_type >::type type
Wrapper for a generic expression template.
static const bool value
Base template specification for IsScalarType.
#define SACADO_INLINE_FUNCTION
Base template specification for ValueType.