From 40b821811176d69f15942fc1a35bbd00cf6940a1 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Mon, 22 Oct 2012 14:25:10 -0400 Subject: Remove Carpet's mechanisms to deal with how to call isnan Remove Carpet's mechanisms to deal with how to call isnan. Instead, expect isnan in std::, and rely on Cactus to correct things if this is not the case. --- Carpet/CarpetIOBasic/src/iobasic.cc | 43 ++++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 15 deletions(-) (limited to 'Carpet/CarpetIOBasic') diff --git a/Carpet/CarpetIOBasic/src/iobasic.cc b/Carpet/CarpetIOBasic/src/iobasic.cc index 2c413e3c2..11c620604 100644 --- a/Carpet/CarpetIOBasic/src/iobasic.cc +++ b/Carpet/CarpetIOBasic/src/iobasic.cc @@ -65,7 +65,34 @@ namespace CarpetIOBasic { void ExamineVariable (int vindex, bool & isint, int & numcomps, bool & isscalar); vector ParseReductions (char const * credlist); - template bool UseScientificNotation (T const & x); + + + + template + bool + UseScientificNotation (T const & x) + { + return false; // default + } + + template <> + bool + UseScientificNotation (CCTK_REAL const & x) + { + DECLARE_CCTK_PARAMETERS; + + static_assert (abs(0.1) > 0, "Function abs has wrong signature"); + + CCTK_REAL const xa = abs (x); + return xa != 0 and (xa < real_min or xa >= real_max); + } + + template <> + bool + UseScientificNotation (CCTK_COMPLEX const & x) + { + return UseScientificNotation(x.real()) or UseScientificNotation(x.imag()); + } @@ -730,18 +757,4 @@ namespace CarpetIOBasic { } } - - - template - bool - UseScientificNotation (T const & x) - { - DECLARE_CCTK_PARAMETERS; - - static_assert (good::abs(0.1) > 0, "Function abs has wrong signature"); - - CCTK_REAL const xa = good::abs (x); - return xa != 0 and (xa < real_min or xa >= real_max); - } - } // namespace CarpetIOBasic -- cgit v1.2.3