From ec5967cfad2a32dd95419719d238cd00b473bc77 Mon Sep 17 00:00:00 2001 From: Oliver Sander <sander@igpm.rwth-aachen.de> Date: Tue, 3 Sep 2013 16:29:42 +0000 Subject: [PATCH] Specialize numeric_limits for adoubles [[Imported from SVN: r9405]] --- dune/gfe/adolcnamespaceinjections.hh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/dune/gfe/adolcnamespaceinjections.hh b/dune/gfe/adolcnamespaceinjections.hh index e99471e0..100224fb 100644 --- a/dune/gfe/adolcnamespaceinjections.hh +++ b/dune/gfe/adolcnamespaceinjections.hh @@ -1,6 +1,8 @@ #ifndef DUNE_GFE_ADOLC_NAMESPACE_INJECTIONS_HH #define DUNE_GFE_ADOLC_NAMESPACE_INJECTIONS_HH +#include <limits> + adouble min_hack(const adouble& a, const adouble& b) { return min(a,b); } @@ -84,6 +86,21 @@ namespace std return std::isinf(a.value()); } + /** \brief Specialization of the numeric_limits class for adouble */ + template <> + struct numeric_limits<adouble> { + + static adouble max() { + return numeric_limits<double>::max(); + } + + static adouble quiet_NaN() { + return numeric_limits<double>::quiet_NaN(); + } + + static constexpr bool is_integer = false; + + }; } #endif \ No newline at end of file -- GitLab