Sacado Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Sacado_Fad_Exp_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_FAD_EXP_EXPRESSIONTRAITS_HPP
11 #define SACADO_FAD_EXP_EXPRESSIONTRAITS_HPP
12 
13 #include "Sacado_Traits.hpp"
14 
16 
17 namespace Sacado {
18 
20  SACADO_EXPR_PROMOTE_SPEC( Fad::Exp )
21 
22 
23  template <typename T>
24  struct ScalarType< Fad::Exp::Expr<T> > {
26  };
27 
29  template <typename T>
30  struct ValueType< Fad::Exp::Expr<T> > {
32  };
33 
35  template <typename T>
36  struct IsADType< Fad::Exp::Expr<T> > {
37  static const bool value = true;
38  };
39 
41  template <typename T>
42  struct IsScalarType< Fad::Exp::Expr<T> > {
43  static const bool value = false;
44  };
45 
47  template <typename T>
48  struct IsSimdType< Fad::Exp::Expr<T> > {
50  };
51 
53  template <typename T>
54  struct Value< Fad::Exp::Expr<T> > {
55  typedef typename ValueType< Fad::Exp::Expr<T> >::type value_type;
57  static const value_type& eval(const Fad::Exp::Expr<T>& x) {
58  return x.val(); }
59  };
60 
62  template <typename T>
63  struct ScalarValue< Fad::Exp::Expr<T> > {
64  typedef typename ValueType< Fad::Exp::Expr<T> >::type value_type;
65  typedef typename ScalarType< Fad::Exp::Expr<T> >::type scalar_type;
67  static const scalar_type& eval(const Fad::Exp::Expr<T>& x) {
68  return ScalarValue<value_type>::eval(x.val()); }
69  };
70 
71 } // namespace Sacado
72 
73 #endif // SACADO_FAD_EXP_EXPRESSIONTRAITS_HPP
static SACADO_INLINE_FUNCTION const T & eval(const T &x)
static SACADO_INLINE_FUNCTION const scalar_type & eval(const Fad::Exp::Expr< T > &x)
Base template specification for ScalarValue.
Base template specification for ScalarType.
ValueType< Fad::Exp::Expr< T > >::type value_type
ScalarType< Fad::Exp::Expr< T > >::type scalar_type
Base template specification for IsADType.
Wrapper for a generic expression template.
Base template specification for Value.
Base template specification for IsSimdType.
#define T
Definition: Sacado_rad.hpp:553
static const bool value
#define SACADO_EXPR_PROMOTE_SPEC(NS)
static SACADO_INLINE_FUNCTION const value_type & eval(const Fad::Exp::Expr< T > &x)
static const bool value
ScalarType< typename Fad::Exp::Expr< T >::value_type >::type type
static const bool value
Base template specification for IsScalarType.
#define SACADO_INLINE_FUNCTION
Base template specification for ValueType.