#define dealii_differentiation_ad_adolc_number_types_h
#include <deal.II/base/config.h>
-
-#ifdef DEAL_II_WITH_ADOLC
-
-#include <adolc/internal/adolc_settings.h>
-#include <adolc/internal/adubfunc.h> // Taped double math functions
-
-#include <adolc/adouble.h> // Taped double
-#include <adolc/adtl.h> // Tapeless double
-
-#include <deal.II/base/numbers.h>
-#include <deal.II/base/exceptions.h>
-
-#include <deal.II/differentiation/ad/ad_number_types.h>
-#include <deal.II/differentiation/ad/ad_number_traits.h>
-
-#include <complex>
#include <type_traits>
DEAL_II_NAMESPACE_OPEN
* @author Jean-Paul Pelteret, 2017
*/
template <typename NumberType, typename = void>
- struct is_adolc_number;
+ struct is_adolc_number
+ : std::false_type
+ {};
+
+
+ /**
+ * A struct to indicate whether a given @p NumberType is a taped
+ * Adol-C number or not. By default, numbers are not considered to
+ * have the necessary characteristics to fulfill this condition.
+ *
+ * @author Jean-Paul Pelteret, 2017
+ */
+ template <typename NumberType, typename = void>
+ struct is_adolc_taped_number
+ : std::false_type
+ {};
+
+
+ /**
+ * A struct to indicate whether a given @p NumberType is a tapeless
+ * Adol-C number or not. By default, numbers are not considered to
+ * have the necessary characteristics to fulfill this condition.
+ *
+ * @author Jean-Paul Pelteret, 2017
+ */
+ template <typename NumberType, typename = void>
+ struct is_adolc_tapeless_number
+ : std::false_type
+ {};
}
}
+DEAL_II_NAMESPACE_CLOSE
+
+
+#ifdef DEAL_II_WITH_ADOLC
+
+#include <adolc/internal/adolc_settings.h>
+#include <adolc/internal/adubfunc.h> // Taped double math functions
+
+#include <adolc/adouble.h> // Taped double
+#include <adolc/adtl.h> // Tapeless double
+
+#include <deal.II/base/numbers.h>
+#include <deal.II/base/exceptions.h>
+
+#include <deal.II/differentiation/ad/ad_number_types.h>
+#include <deal.II/differentiation/ad/ad_number_traits.h>
+
+#include <complex>
+#include <type_traits>
+
+DEAL_II_NAMESPACE_OPEN
+
+
/* --------------------------- inline and template functions and specializations ------------------------- */
{};
-
/**
- * A struct to indicate whether a given @p NumberType is an
- * Adol-C number or not. By default, numbers are not considered to
- * have the necessary characteristics to fulfill this condition.
+ * Specialization of the struct for the case when the input template
+ * parameter is a (real or complex) taped Adol-C number.
*/
- template <typename NumberType, typename>
- struct is_adolc_number
- : std::false_type
+ template <typename NumberType>
+ struct is_adolc_taped_number<NumberType, typename std::enable_if<
+ ADNumberTraits<typename std::decay<NumberType>::type>::type_code == NumberTypes::adolc_taped
+ >::type>
+ : std::true_type
{};
+ /**
+ * Specialization of the struct for the case when the input template
+ * parameter is a (real or complex) tapeless Adol-C number.
+ */
+ template <typename NumberType>
+ struct is_adolc_tapeless_number<NumberType, typename std::enable_if<
+ ADNumberTraits<typename std::decay<NumberType>::type>::type_code == NumberTypes::adolc_tapeless
+ >::type>
+ : std::true_type
+ {};
+
/**
* Specialization of the struct for the case when the input template
*/
template <typename NumberType>
struct is_adolc_number<NumberType, typename std::enable_if<
- ADNumberTraits<typename std::decay<NumberType>::type>::type_code == NumberTypes::adolc_taped ||
- ADNumberTraits<typename std::decay<NumberType>::type>::type_code == NumberTypes::adolc_tapeless
+ is_adolc_taped_number<NumberType>::value ||
+ is_adolc_tapeless_number<NumberType>::value
>::type>
: std::true_type
{};