aboutsummaryrefslogtreecommitdiff
path: root/Carpet
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@gmail.com>2012-10-22 14:25:10 -0400
committerErik Schnetter <schnetter@gmail.com>2012-10-22 14:25:10 -0400
commit40b821811176d69f15942fc1a35bbd00cf6940a1 (patch)
treef8e30ae80a318f19d7b50ba9ff5fce724f1feaea /Carpet
parent2d5752398c5844a24f3146792b2e93510552c19e (diff)
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.
Diffstat (limited to 'Carpet')
-rw-r--r--Carpet/Carpet/src/Hosts.cc1
-rw-r--r--Carpet/Carpet/src/MultiModel.cc1
-rw-r--r--Carpet/Carpet/src/functions.hh1
-rw-r--r--Carpet/CarpetIOBasic/src/iobasic.cc43
-rw-r--r--Carpet/CarpetLib/src/defs.hh367
-rw-r--r--Carpet/CarpetLib/src/gh.cc2
-rw-r--r--Carpet/CarpetLib/src/prolongate_3d_cc_eno_rf2.cc2
-rw-r--r--Carpet/CarpetLib/src/prolongate_3d_cc_rf2.cc2
-rw-r--r--Carpet/CarpetLib/src/prolongate_3d_rf2.cc4
-rw-r--r--Carpet/CarpetLib/src/vect.hh14
-rw-r--r--Carpet/CarpetReduce/src/reduce.cc47
11 files changed, 74 insertions, 410 deletions
diff --git a/Carpet/Carpet/src/Hosts.cc b/Carpet/Carpet/src/Hosts.cc
index b8243cab0..c10973c0e 100644
--- a/Carpet/Carpet/src/Hosts.cc
+++ b/Carpet/Carpet/src/Hosts.cc
@@ -23,6 +23,7 @@ namespace Carpet
{
using namespace std;
+ using namespace CarpetLib;
diff --git a/Carpet/Carpet/src/MultiModel.cc b/Carpet/Carpet/src/MultiModel.cc
index cc0335bee..0ba2b94c5 100644
--- a/Carpet/Carpet/src/MultiModel.cc
+++ b/Carpet/Carpet/src/MultiModel.cc
@@ -22,6 +22,7 @@ namespace Carpet
{
using namespace std;
+ using namespace CarpetLib;
diff --git a/Carpet/Carpet/src/functions.hh b/Carpet/Carpet/src/functions.hh
index 163381ce4..b31c6740d 100644
--- a/Carpet/Carpet/src/functions.hh
+++ b/Carpet/Carpet/src/functions.hh
@@ -24,7 +24,6 @@
namespace Carpet {
using namespace std;
- using namespace CarpetLib;
int SyncGroupsByDirI (const cGH* cctkGH, int num_groups,
const int* groups, const int* directions);
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<string> ParseReductions (char const * credlist);
- template <typename T> bool UseScientificNotation (T const & x);
+
+
+
+ template <typename T>
+ 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 <typename T>
- 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
diff --git a/Carpet/CarpetLib/src/defs.hh b/Carpet/CarpetLib/src/defs.hh
index 373d6bb29..f41b19d86 100644
--- a/Carpet/CarpetLib/src/defs.hh
+++ b/Carpet/CarpetLib/src/defs.hh
@@ -191,349 +191,48 @@ inline const char * typestring (const CCTK_COMPLEX32&)
#endif
+
+// Provide implementations for some functions for complex numbers
+
+#define IMPLEMENT_FUNCTIONS(T) \
+ \
+ inline int good_isfinite(T const& x) \
+ { \
+ return isfinite(x.real()) and isfinite(x.imag()); \
+ } \
+ \
+ inline int good_isinf(T const& x) \
+ { \
+ return isinf(x.real()) or isinf(x.imag()); \
+ } \
+ \
+ inline int good_isnan(T const& x) \
+ { \
+ return isnan(x.real()) or isnan(x.imag()); \
+ } \
+ \
+ inline int good_isnormal(T const& x) \
+ { \
+ return isnormal(x.real()) or isnormal(x.imag()); \
+ }
-// Capture the system's fpclassify, isfinite, isinf, isnan, and
-// isnormal functions
-
-// #ifdef HAVE_CCTK_REAL4
-// inline int myfpclassify (CCTK_REAL4 const x)
-// { return fpclassify (x); }
-// #endif
-// #ifdef HAVE_CCTK_REAL8
-// inline int myfpclassify (CCTK_REAL8 const x)
-// { return fpclassify (x); }
-// #endif
-// #ifdef HAVE_CCTK_REAL16
-// inline int myfpclassify (CCTK_REAL16 const x)
-// { return fpclassify (x); }
-// #endif
-//
-// #undef fpclassify
-
-#ifdef HAVE_CCTK_REAL4
-inline int myisfinite (CCTK_REAL4 const x)
-{ return isfinite (x); }
-#endif
-#ifdef HAVE_CCTK_REAL8
-inline int myisfinite (CCTK_REAL8 const x)
-{ return isfinite (x); }
-#endif
-#ifdef HAVE_CCTK_REAL16
-inline int myisfinite (CCTK_REAL16 const x)
-{ return isfinite (x); }
-#endif
-
-#undef isfinite
-
-#ifdef HAVE_CCTK_REAL4
-inline int myisinf (CCTK_REAL4 const x)
-{ return isinf (x); }
-#endif
-#ifdef HAVE_CCTK_REAL8
-inline int myisinf (CCTK_REAL8 const x)
-{ return isinf (x); }
-#endif
-#ifdef HAVE_CCTK_REAL16
-inline int myisinf (CCTK_REAL16 const x)
-{ return isinf (x); }
-#endif
-
-#undef isinf
-
-#ifdef HAVE_CCTK_REAL4
-inline int myisnan (CCTK_REAL4 const x)
-{ return isnan (x); }
-#endif
-#ifdef HAVE_CCTK_REAL8
-inline int myisnan (CCTK_REAL8 const x)
-{ return isnan (x); }
-#endif
-#ifdef HAVE_CCTK_REAL16
-inline int myisnan (CCTK_REAL16 const x)
-{ return isnan (x); }
-#endif
-
-#undef isnan
-
-#ifdef HAVE_CCTK_REAL4
-inline int myisnormal (CCTK_REAL4 const x)
-{ return isnormal (x); }
-#endif
-#ifdef HAVE_CCTK_REAL8
-inline int myisnormal (CCTK_REAL8 const x)
-{ return isnormal (x); }
-#endif
-#ifdef HAVE_CCTK_REAL16
-inline int myisnormal (CCTK_REAL16 const x)
-{ return isnormal (x); }
-#endif
-
-#undef isnormal
-
-
-
-namespace CarpetLib {
- namespace good {
-
- // Explicitly overload some functions for all types in the same
- // namespace CarpetLib::good, to circumvent confusion among some
- // compilers
-
- //
- // abs
- //
-
- template <typename T>
- inline typename typeprops<T>::real abs (T const x)
- { return std::abs (x); }
-
-// // This does not work on Linux with Intel compilers, which do not
-// // always have long long llabs (long long)
-// template<> inline signed char abs<signed char> (signed char const x) { return ::abs (x); }
-// template<> inline unsigned char abs<unsigned char> (unsigned char const x) CCTK_ATTRIBUTE_CONST { return ::abs (x); }
-// template<> inline short abs<short> (short const x) { return ::abs (x); }
-// template<> inline int abs<int> (int const x) { return ::abs (x); }
-// template<> inline long abs<long> (long const x) { return ::labs (x); }
-// #ifdef SIZEOF_LONG_LONG
-// inline long long abs<long long> (long long const x) { return ::llabs (x); }
-// #endif
-
-// // This template does not work on AIX, which does not have long
-// // long abs (long long)
-// #ifdef HAVE_CCTK_INT1
-// template<> inline CCTK_INT1 abs<CCTK_INT1> (CCTK_INT1 const x) { return x < 0 ? - x : x; }
-// #endif
-// #ifdef HAVE_CCTK_INT2
-// template<> inline CCTK_INT2 abs<CCTK_INT2> (CCTK_INT2 const x) { return x < 0 ? - x : x; }
-// #endif
-// #ifdef HAVE_CCTK_INT4
-// template<> inline CCTK_INT4 abs<CCTK_INT4> (CCTK_INT4 const x) { return x < 0 ? - x : x; }
-// #endif
-// #ifdef HAVE_CCTK_INT8
-// template<> inline CCTK_INT8 abs<CCTK_INT8> (CCTK_INT8 const x) { return x < 0 ? - x : x; }
-// #endif
-
-#ifdef HAVE_CCTK_COMPLEX8
- template<> inline CCTK_REAL4 abs<CCTK_COMPLEX8> (CCTK_COMPLEX8 const x)
- { return CCTK_Cmplx8Abs (x); }
-#endif
-#ifdef HAVE_CCTK_COMPLEX16
- template<> inline CCTK_REAL8 abs<CCTK_COMPLEX16> (CCTK_COMPLEX16 const x)
- { return CCTK_Cmplx16Abs (x); }
-#endif
-#ifdef HAVE_CCTK_COMPLEX32
- template<> inline CCTK_REAL16 abs<CCTK_COMPLEX32> (CCTK_COMPLEX32 const x)
- { return CCTK_Cmplx32Abs (x); }
-#endif
-
-// //
-// // fpclassify
-// //
-//
-// // Default implementation, only good for integers
-// template <typename T>
-// inline int fpclassify (T const x)
-// { return x ? FP_NORMAL : FP_ZERO; }
-//
-// #ifdef HAVE_CCTK_REAL4
-// template<> inline int fpclassify (CCTK_REAL4 const x)
-// { return myfpclassify (x); }
-// #endif
-// #ifdef HAVE_CCTK_REAL8
-// template<> inline int fpclassify (CCTK_REAL8 const x)
-// { return myfpclassify (x); }
-// #endif
-// #ifdef HAVE_CCTK_REAL16
-// template<> inline int fpclassify (CCTK_REAL16 const x)
-// { return myfpclassify (x); }
-// #endif
-//
-// #ifdef HAVE_CCTK_COMPLEX8
-// template<> inline int fpclassify (CCTK_COMPLEX8 const x)
-// { assert(0); }
-// #endif
-// #ifdef HAVE_CCTK_COMPLEX16
-// template<> inline int fpclassify (CCTK_COMPLEX16 const x)
-// { assert(0); }
-// #endif
-// #ifdef HAVE_CCTK_COMPLEX32
-// template<> inline int fpclassify (CCTK_COMPLEX32 const x)
-// { assert(0); }
-// #endif
-
- //
- // isfinite
- //
-
- // Default implementation, only good for integers
- template <typename T>
- inline int isfinite (T const x)
- { return 1; }
-
-#ifdef HAVE_CCTK_REAL4
- template<> inline int isfinite (CCTK_REAL4 const x)
- { return myisfinite (x); }
-#endif
-#ifdef HAVE_CCTK_REAL8
- template<> inline int isfinite (CCTK_REAL8 const x)
- { return myisfinite (x); }
-#endif
-#ifdef HAVE_CCTK_REAL16
- template<> inline int isfinite (CCTK_REAL16 const x)
- { return myisfinite (x); }
-#endif
-
-#ifdef HAVE_CCTK_COMPLEX8
- template<> inline int isfinite (CCTK_COMPLEX8 const x)
- { return myisfinite (CCTK_Cmplx8Real (x)) and myisfinite (CCTK_Cmplx8Imag (x)); }
-#endif
-#ifdef HAVE_CCTK_COMPLEX16
- template<> inline int isfinite (CCTK_COMPLEX16 const x)
- { return myisfinite (CCTK_Cmplx16Real (x)) and myisfinite (CCTK_Cmplx16Imag (x)); }
-#endif
-#ifdef HAVE_CCTK_COMPLEX32
- template<> inline int isfinite (CCTK_COMPLEX32 const x)
- { return myisfinite (CCTK_Cmplx32Real (x)) and myisfinite (CCTK_Cmplx32Imag (x)); }
-#endif
-
- //
- // isinf
- //
-
- // Default implementation, only good for integers
- template <typename T>
- inline int isinf (T const x)
- { return 0; }
-
-#ifdef HAVE_CCTK_REAL4
- template<> inline int isinf (CCTK_REAL4 const x)
- { return myisinf (x); }
-#endif
-#ifdef HAVE_CCTK_REAL8
- template<> inline int isinf (CCTK_REAL8 const x)
- { return myisinf (x); }
-#endif
-#ifdef HAVE_CCTK_REAL16
- template<> inline int isinf (CCTK_REAL16 const x)
- { return myisinf (x); }
-#endif
-
-#ifdef HAVE_CCTK_COMPLEX8
- template<> inline int isinf (CCTK_COMPLEX8 const x)
- { return myisinf (CCTK_Cmplx8Real (x)) or myisinf (CCTK_Cmplx8Imag (x)); }
-#endif
-#ifdef HAVE_CCTK_COMPLEX16
- template<> inline int isinf (CCTK_COMPLEX16 const x)
- { return myisinf (CCTK_Cmplx16Real (x)) or myisinf (CCTK_Cmplx16Imag (x)); }
-#endif
-#ifdef HAVE_CCTK_COMPLEX32
- template<> inline int isinf (CCTK_COMPLEX32 const x)
- { return myisinf (CCTK_Cmplx32Real (x)) or myisinf (CCTK_Cmplx32Imag (x)); }
-#endif
-
- //
- // isnan
- //
-
- // Default implementation, only good for integers
- template <typename T>
- inline int isnan (T const x)
- { return 0; }
-
-#ifdef HAVE_CCTK_REAL4
- template<> inline int isnan (CCTK_REAL4 const x)
- { return myisnan (x); }
-#endif
-#ifdef HAVE_CCTK_REAL8
- template<> inline int isnan (CCTK_REAL8 const x)
- { return myisnan (x); }
-#endif
-#ifdef HAVE_CCTK_REAL16
- template<> inline int isnan (CCTK_REAL16 const x)
- { return myisnan (x); }
-#endif
-
-#ifdef HAVE_CCTK_COMPLEX8
- template<> inline int isnan (CCTK_COMPLEX8 const x)
- { return myisnan (CCTK_Cmplx8Real (x)) or myisnan (CCTK_Cmplx8Imag (x)); }
-#endif
-#ifdef HAVE_CCTK_COMPLEX16
- template<> inline int isnan (CCTK_COMPLEX16 const x)
- { return myisnan (CCTK_Cmplx16Real (x)) or myisnan (CCTK_Cmplx16Imag (x)); }
-#endif
-#ifdef HAVE_CCTK_COMPLEX32
- template<> inline int isnan (CCTK_COMPLEX32 const x)
- { return myisnan (CCTK_Cmplx32Real (x)) or myisnan (CCTK_Cmplx32Imag (x)); }
-#endif
-
- //
- // isnormal
- //
-
- // Default implementation, only good for integers
- template <typename T>
- inline int isnormal (T const x)
- { return 1; }
-
-#ifdef HAVE_CCTK_REAL4
- template<> inline int isnormal (CCTK_REAL4 const x)
- { return myisnormal (x); }
-#endif
-#ifdef HAVE_CCTK_REAL8
- template<> inline int isnormal (CCTK_REAL8 const x)
- { return myisnormal (x); }
-#endif
-#ifdef HAVE_CCTK_REAL16
- template<> inline int isnormal (CCTK_REAL16 const x)
- { return myisnormal (x); }
-#endif
-
+namespace std {
+ namespace Cactus {
+
#ifdef HAVE_CCTK_COMPLEX8
- template<> inline int isnormal (CCTK_COMPLEX8 const x)
- { return myisnormal (CCTK_Cmplx8Real (x)) and myisnormal (CCTK_Cmplx8Imag (x)); }
+ IMPLEMENT_FUNCTIONS(CCTK_COMPLEX8)
#endif
#ifdef HAVE_CCTK_COMPLEX16
- template<> inline int isnormal (CCTK_COMPLEX16 const x)
- { return myisnormal (CCTK_Cmplx16Real (x)) and myisnormal (CCTK_Cmplx16Imag (x)); }
+ IMPLEMENT_FUNCTIONS(CCTK_COMPLEX16)
#endif
#ifdef HAVE_CCTK_COMPLEX32
- template<> inline int isnormal (CCTK_COMPLEX32 const x)
- { return myisnormal (CCTK_Cmplx32Real (x)) and myisnormal (CCTK_Cmplx32Imag (x)); }
+ IMPLEMENT_FUNCTIONS(CCTK_COMPLEX32)
#endif
- } // namespace good
-} // namespace CarpetLib
-
-
-
-// Use #defines to access the CarpetLib::good functions from the
-// global namespace. Because macros are not scoped, this makes the
-// corresponding functions in CarpetLib::good inaccessible, so we
-// rename them by adding an underscore.
-
-namespace CarpetLib {
- namespace good {
-
-#define ALIAS_GOOD_FUNCTION(typ,func) \
- template <typename T> \
- inline typ func##_ (T const x) \
- { return func (x); }
-
- // ALIAS_GOOD_FUNCTION(int,fpclassify)
- ALIAS_GOOD_FUNCTION(int,isfinite)
- ALIAS_GOOD_FUNCTION(int,isinf)
- ALIAS_GOOD_FUNCTION(int,isnan)
- ALIAS_GOOD_FUNCTION(int,isnormal)
-
-#undef ALIAS_GOOD_FUNCTION
-
- } // namespace good
-} // namespace CarpetLib
+ }
+}
-#define isfinite (::CarpetLib::good::isfinite_)
-#define isinf (::CarpetLib::good::isinf_)
-#define isnan (::CarpetLib::good::isnan_)
-#define isnormal (::CarpetLib::good::isnormal_)
+#undef IMPLEMENT_FUNCTIONS
diff --git a/Carpet/CarpetLib/src/gh.cc b/Carpet/CarpetLib/src/gh.cc
index 6bb0adb1d..e78786107 100644
--- a/Carpet/CarpetLib/src/gh.cc
+++ b/Carpet/CarpetLib/src/gh.cc
@@ -17,8 +17,6 @@
using namespace std;
-using namespace CarpetLib;
-
list<gh*> gh::allgh;
diff --git a/Carpet/CarpetLib/src/prolongate_3d_cc_eno_rf2.cc b/Carpet/CarpetLib/src/prolongate_3d_cc_eno_rf2.cc
index cc00464cc..5cd8fdd2c 100644
--- a/Carpet/CarpetLib/src/prolongate_3d_cc_eno_rf2.cc
+++ b/Carpet/CarpetLib/src/prolongate_3d_cc_eno_rf2.cc
@@ -142,7 +142,7 @@ namespace CarpetLib {
RT const x0 = RT(0.25) + di * RT(0.5);
//cout << "x0=" << x0 << endl;
RT const y0 = ipow (x0, n);
- if (not (good::abs (res - y0) < 1.0e-12)) {
+ if (not (abs (res - y0) < 1.0e-12)) {
RT rt;
ostringstream buf;
buf << "Error in prolongate_3d_cc_rf2::coeffs_3d_cc_rf2\n"
diff --git a/Carpet/CarpetLib/src/prolongate_3d_cc_rf2.cc b/Carpet/CarpetLib/src/prolongate_3d_cc_rf2.cc
index 827d6d611..bf960f0aa 100644
--- a/Carpet/CarpetLib/src/prolongate_3d_cc_rf2.cc
+++ b/Carpet/CarpetLib/src/prolongate_3d_cc_rf2.cc
@@ -113,7 +113,7 @@ namespace CarpetLib {
RT const y0 = ipow (x0, n);
// Allow losing 3 digits:
CCTK_REAL const eps = RT(1.0e+3) * numeric_limits<RT>::epsilon();
- if (not (good::abs (res - y0) < eps)) {
+ if (not (abs (res - y0) < eps)) {
RT rt;
ostringstream buf;
buf << "Error in prolongate_3d_cc_rf2::coeffs_3d_cc_rf2\n"
diff --git a/Carpet/CarpetLib/src/prolongate_3d_rf2.cc b/Carpet/CarpetLib/src/prolongate_3d_rf2.cc
index 98727536d..984d68c07 100644
--- a/Carpet/CarpetLib/src/prolongate_3d_rf2.cc
+++ b/Carpet/CarpetLib/src/prolongate_3d_rf2.cc
@@ -71,7 +71,7 @@ namespace CarpetLib {
// Do not test integer operators (they should be disabled
// anyway)
- if (good::abs (RT(0.5) - 0.5) > 1.0e-5) return;
+ if (abs (RT(0.5) - 0.5) > 1.0e-5) return;
// Test all orders
bool error = false;
@@ -86,7 +86,7 @@ namespace CarpetLib {
RT const y0 = ipow (x0, n);
// Allow losing 3 digits:
CCTK_REAL const eps = RT(1.0e+3) * numeric_limits<RT>::epsilon();
- if (not (good::abs (res - y0) < eps)) {
+ if (not (abs (res - y0) < eps)) {
RT rt;
ostringstream buf;
buf << "Error in prolongate_3d_rf2::coeffs_3d_rf2\n"
diff --git a/Carpet/CarpetLib/src/vect.hh b/Carpet/CarpetLib/src/vect.hh
index 63a6b041b..a8b88196d 100644
--- a/Carpet/CarpetLib/src/vect.hh
+++ b/Carpet/CarpetLib/src/vect.hh
@@ -375,13 +375,13 @@ DECLARE_FUNCTION_1 (abs)
DECLARE_FUNCTION_1 (ceil)
DECLARE_FUNCTION_1 (floor)
DECLARE_FUNCTION_1 (sqrt)
-namespace CarpetLib {
- namespace good {
- // DECLARE_FUNCTION_1_RET (fpclassify, int)
- DECLARE_FUNCTION_1_RET (isfinite_, int)
- DECLARE_FUNCTION_1_RET (isinf_, int)
- DECLARE_FUNCTION_1_RET (isnan_, int)
- DECLARE_FUNCTION_1_RET (isnormal_, int)
+namespace std {
+ namespace Cactus {
+ DECLARE_FUNCTION_1_RET (good_fpclassify, int)
+ DECLARE_FUNCTION_1_RET (good_isfinite, int)
+ DECLARE_FUNCTION_1_RET (good_isinf, int)
+ DECLARE_FUNCTION_1_RET (good_isnan, int)
+ DECLARE_FUNCTION_1_RET (good_isnormal, int)
}
}
diff --git a/Carpet/CarpetReduce/src/reduce.cc b/Carpet/CarpetReduce/src/reduce.cc
index f9969647b..5ee5a6360 100644
--- a/Carpet/CarpetReduce/src/reduce.cc
+++ b/Carpet/CarpetReduce/src/reduce.cc
@@ -42,13 +42,6 @@ namespace CarpetReduce {
// Helper functions and types
- // Whether a value is nan
- template<typename T> static inline int
- myisnan (const T x)
- {
- return isnan(x);
- }
-
// The minimum of two values
template<typename T> static inline T
mymin (const T x, const T y)
@@ -127,11 +120,6 @@ namespace CarpetReduce {
// The C++ compiler should supply these, but some old ones do not,
// e.g. our beloved workhorse Intel 7.1. Self is the man.
#ifdef HAVE_CCTK_BYTE
-// template<> static inline int myisnan (CCTK_BYTE const x)
-// {
-// return 0;
-// }
-
template<> inline CCTK_BYTE mysqr (CCTK_BYTE const x)
{
// prevent overflow
@@ -152,11 +140,6 @@ namespace CarpetReduce {
#endif
#ifdef HAVE_CCTK_INT1
-// template<> static inline int myisnan (CCTK_INT1 const x)
-// {
-// return 0;
-// }
-
template<> inline CCTK_INT1 mysqr (CCTK_INT1 const x)
{
// prevent overflow
@@ -177,11 +160,6 @@ namespace CarpetReduce {
#endif
#ifdef HAVE_CCTK_INT2
-// template<> static inline int myisnan (CCTK_INT2 const x)
-// {
-// return 0;
-// }
-
template<> inline CCTK_INT2 mysqr (CCTK_INT2 const x)
{
// prevent overflow
@@ -202,11 +180,6 @@ namespace CarpetReduce {
#endif
#ifdef HAVE_CCTK_INT4
-// template<> inline int myisnan (CCTK_INT4 const x)
-// {
-// return 0;
-// }
-
template<> inline CCTK_INT4 mysqr (CCTK_INT4 const x)
{
// prevent overflow
@@ -227,11 +200,6 @@ namespace CarpetReduce {
#endif
#ifdef HAVE_CCTK_INT8
-// template<> inline int myisnan (CCTK_INT8 const x)
-// {
-// return 0;
-// }
-
template<> inline CCTK_INT8 mysqr (CCTK_INT8 const x)
{
// prevent overflow
@@ -257,11 +225,6 @@ namespace CarpetReduce {
#ifdef HAVE_CCTK_REAL4
- // template<> inline int myisnan (complex<CCTK_REAL4> const x)
- // {
- // return isnan (x.real()) or isnan (x.imag());
- // }
-
template<> inline complex<CCTK_REAL4>
mymin (const complex<CCTK_REAL4> x, const complex<CCTK_REAL4> y)
{
@@ -306,11 +269,6 @@ namespace CarpetReduce {
#ifdef HAVE_CCTK_REAL8
- // template<> inline int myisnan (complex<CCTK_REAL8> const x)
- // {
- // return isnan (x.real()) or isnan (x.imag());
- // }
-
template<> inline complex<CCTK_REAL8>
mymin (const complex<CCTK_REAL8> x, const complex<CCTK_REAL8> y)
{
@@ -355,11 +313,6 @@ namespace CarpetReduce {
#ifdef HAVE_CCTK_REAL16
- // template<> inline int myisnan (complex<CCTK_REAL16> const x)
- // {
- // return isnan (x.real()) or isnan (x.imag());
- // }
-
template<> inline complex<CCTK_REAL16>
mymin (const complex<CCTK_REAL16> x, const complex<CCTK_REAL16> y)
{