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_Expression.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_EXPRESSION_HPP
11 #define SACADO_FAD_EXP_EXPRESSION_HPP
12 
13 #include "Sacado_Traits.hpp"
14 
15 namespace Sacado {
16 
17  namespace Fad {
18  namespace Exp {
19 
21 
34  template <typename T>
35  class Expr {
36  public:
37 
39 
43  typedef T derived_type;
44 
46 
51  const derived_type& derived() const {
52  return static_cast<const derived_type&>(*this);
53  }
54 
56 
61  const volatile derived_type& derived() const volatile {
62  return static_cast<const volatile derived_type&>(*this);
63  }
64  };
65 
67 
72  template <typename T>
73  struct ExprLevel {
74  static constexpr unsigned value = 0;
75  };
76 
77  template <typename T>
78  struct ExprLevel< Expr<T> > {
79  static constexpr unsigned value =
81  };
82 
84  template <typename T>
85  struct IsFadExpr {
86  static constexpr bool value = false;
87  };
88 
89  template <typename T>
90  struct IsFadExpr< Expr<T> > {
91  static constexpr bool value = true;
92  };
93 
94  // Tag for delegating expression template specializations
95  class ExprSpecDefault {};
96 
97  } // namespace Exp
98  } // namespace Fad
99 
100  template <typename T>
101  struct IsExpr< Fad::Exp::Expr<T> > {
102  static constexpr bool value = true;
103  };
104 
105  template <typename T>
106  struct BaseExprType< Fad::Exp::Expr<T> > {
107  typedef typename BaseExprType<T>::type type;
108  };
109 
110 } // namespace Sacado
111 
112 #include "Sacado_SFINAE_Macros.hpp"
113 
114 #endif // SACADO_FAD_EXP_EXPRESSION_HPP
SACADO_INLINE_FUNCTION const volatile derived_type & derived() const volatile
Return derived object.
Determine whether a given type is an expression.
static const bool value
Wrapper for a generic expression template.
Is a type an expression.
#define T
Definition: Sacado_rad.hpp:553
SACADO_INLINE_FUNCTION const derived_type & derived() const
Return derived object.
Forward-mode AD class templated on the storage for the derivative array.
Get the base Fad type from a view/expression.
T derived_type
Typename of derived object, returned by derived()
Meta-function for determining nesting with an expression.
#define SACADO_INLINE_FUNCTION