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