aboutsummaryrefslogtreecommitdiff
path: root/src/InterpLocalUniform.h
diff options
context:
space:
mode:
authorjthorn <jthorn@0f49ee68-0e4f-0410-9b9c-b2c123ded7ef>2006-08-13 19:54:28 +0000
committerjthorn <jthorn@0f49ee68-0e4f-0410-9b9c-b2c123ded7ef>2006-08-13 19:54:28 +0000
commit8bf581ab72264463f2da5136e5385011d431ffe2 (patch)
treecf375fb7bf2d842f0ca68c87fce9b22dd4d39465 /src/InterpLocalUniform.h
parent57f2e0c8839578e57770cac1beca01880e8ae607 (diff)
fix a nasty bug where, if the interpolation coordinate was close to
a grid boundary, the actual interpolation was sometimes done as if the interpolation coordinate was displaced by one grid spacing :( :( also add more debugging code (introduced to help track down this bug, but there's no harm in leaving it in for possible future use) also add explicit checks for a couple of error cases: * interpolation coordinate is not a finite number (eg NaN or infinity) * grid origin/delta not a finite number (eg NaN or infinity) * grid spacing is 0 (we need to divide by this!) also add explicit note about the test driver in this directory git-svn-id: http://svn.aei.mpg.de/numrel/AEIThorns/AEILocalInterp/trunk@35 0f49ee68-0e4f-0410-9b9c-b2c123ded7ef
Diffstat (limited to 'src/InterpLocalUniform.h')
-rw-r--r--src/InterpLocalUniform.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/InterpLocalUniform.h b/src/InterpLocalUniform.h
index a111f02..bb412d0 100644
--- a/src/InterpLocalUniform.h
+++ b/src/InterpLocalUniform.h
@@ -35,7 +35,7 @@ typedef int bool;
/* round floating-point value to nearest integer */
/* ... result is expressed as floating point! */
/* ... needs <math.h> for floor() */
-#define JT_ROUND(x) floor((x) + 0.5)
+#define ROUND_TO_INTEGER__RESULT_IS_FP(x) floor((x) + 0.5)
/******************************************************************************/
@@ -175,6 +175,9 @@ struct Jacobian_info
/* grid is smaller than molecule */
#define MOLECULE_POSN_ERROR_GRID_TINY (-3)
+/* someone passed us a NaN or other non-finite floating-point number */
+#define MOLECULE_POSN_ERROR_NAN (-4)
+
/******************************************************************************/
/*