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_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_EXPRESSIONTRAITS_HPP
11 #define SACADO_FAD_EXPRESSIONTRAITS_HPP
12 
13 #include "Sacado_ConfigDefs.h"
14 
15 #ifdef SACADO_NEW_FAD_DESIGN_IS_DEFAULT
16 
18 
19 #else
20 
21 #include "Sacado_Traits.hpp"
22 
24 
25 namespace Sacado {
26 
29 
30 
31  template <typename T>
32  struct ScalarType< Fad::Expr<T> > {
34  };
35 
37  template <typename T>
38  struct ValueType< Fad::Expr<T> > {
39  typedef typename Fad::Expr<T>::value_type type;
40  };
41 
43  template <typename T>
44  struct IsADType< Fad::Expr<T> > {
45  static const bool value = true;
46  };
47 
49  template <typename T>
50  struct IsScalarType< Fad::Expr<T> > {
51  static const bool value = false;
52  };
53 
55  template <typename T>
56  struct IsSimdType< Fad::Expr<T> > {
58  };
59 
61  template <typename T>
62  struct Value< Fad::Expr<T> > {
63  typedef typename ValueType< Fad::Expr<T> >::type value_type;
65  static const value_type& eval(const Fad::Expr<T>& x) {
66  return x.val(); }
67  };
68 
70  template <typename T>
71  struct ScalarValue< Fad::Expr<T> > {
72  typedef typename ValueType< Fad::Expr<T> >::type value_type;
73  typedef typename ScalarType< Fad::Expr<T> >::type scalar_type;
75  static const scalar_type& eval(const Fad::Expr<T>& x) {
76  return ScalarValue<value_type>::eval(x.val()); }
77  };
78 
79 } // namespace Sacado
80 
81 #endif // SACADO_NEW_FAD_DESIGN_IS_DEFAULT
82 
83 #endif // SACADO_FAD_EXPRESSIONTRAITS_HPP
static SACADO_INLINE_FUNCTION const T & eval(const T &x)
Wrapper for a generic expression template.
Base template specification for ScalarValue.
Base template specification for ScalarType.
Base template specification for IsADType.
Base template specification for Value.
Base template specification for IsSimdType.
static SACADO_INLINE_FUNCTION const scalar_type & eval(const Fad::Expr< T > &x)
#define T
Definition: Sacado_rad.hpp:553
static const bool value
#define SACADO_EXPR_PROMOTE_SPEC(NS)
ValueType< Fad::Expr< T > >::type value_type
ScalarType< typename Fad::Expr< T >::value_type >::type type
static const bool value
static const bool value
Base template specification for IsScalarType.
ScalarType< Fad::Expr< T > >::type scalar_type
static SACADO_INLINE_FUNCTION const value_type & eval(const Fad::Expr< T > &x)
#define SACADO_INLINE_FUNCTION
Base template specification for ValueType.
ValueType< Fad::Expr< T > >::type value_type