Sacado Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Sacado_ELRCacheFad_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_ELRCACHEFAD_EXPRESSIONTRAITS_HPP
11 #define SACADO_ELRCACHEFAD_EXPRESSIONTRAITS_HPP
12 
13 #include "Sacado_Traits.hpp"
14 
15 // Forward declarations
16 namespace Sacado {
17  namespace ELRCacheFad {
18  template <typename T> class Expr;
19  }
20 }
21 
22 namespace Sacado {
23 
25  SACADO_EXPR_PROMOTE_SPEC( ELRCacheFad )
26 
27 
28  template <typename T>
29  struct ScalarType< ELRCacheFad::Expr<T> > {
31  };
32 
34  template <typename T>
35  struct ValueType< ELRCacheFad::Expr<T> > {
37  };
38 
40  template <typename T>
41  struct IsADType< ELRCacheFad::Expr<T> > {
42  static const bool value = true;
43  };
44 
46  template <typename T>
47  struct IsScalarType< ELRCacheFad::Expr<T> > {
48  static const bool value = false;
49  };
50 
52  template <typename T>
53  struct Value< ELRCacheFad::Expr<T> > {
54  typedef typename ValueType< ELRCacheFad::Expr<T> >::type value_type;
56  static const value_type& eval(const ELRCacheFad::Expr<T>& x) {
57  return x.val(); }
58  };
59 
61  template <typename T>
62  struct ScalarValue< ELRCacheFad::Expr<T> > {
63  typedef typename ValueType< ELRCacheFad::Expr<T> >::type value_type;
66  static const scalar_type& eval(const ELRCacheFad::Expr<T>& x) {
67  return ScalarValue<value_type>::eval(x.val()); }
68  };
69 
70 } // namespace Sacado
71 
72 #endif // SACADO_ELRCACHEFAD_EXPRESSIONTRAITS_HPP
static SACADO_INLINE_FUNCTION const T & eval(const T &x)
Base template specification for ScalarValue.
static SACADO_INLINE_FUNCTION const value_type & eval(const ELRCacheFad::Expr< T > &x)
Base template specification for ScalarType.
ValueType< ELRCacheFad::Expr< T > >::type value_type
Base template specification for IsADType.
Base template specification for Value.
#define T
Definition: Sacado_rad.hpp:553
ScalarType< typename ELRCacheFad::Expr< T >::value_type >::type type
static const bool value
#define SACADO_EXPR_PROMOTE_SPEC(NS)
Wrapper for a generic expression template.
static SACADO_INLINE_FUNCTION const scalar_type & eval(const ELRCacheFad::Expr< T > &x)
static const bool value
Base template specification for IsScalarType.
#define SACADO_INLINE_FUNCTION
Base template specification for ValueType.