r7061: initial property settings
[ctsim.git] / libctsupport / interpolator.cpp
index e8abdfa0bfc259517b4978ec72818cb23f166b4d..ace70fdd70a0bbc9312f05fe2b91e6ecaa75cc3a 100644 (file)
@@ -2,7 +2,7 @@
 **  This is part of the CTSim program
 **  Copyright (c) 1983-2001 Kevin Rosenberg
 **
-**  $Id: interpolator.cpp,v 1.1 2001/02/11 21:57:08 kevin Exp $
+**  $Id$
 **
 **  This program is free software; you can redistribute it and/or modify
 **  it under the terms of the GNU General Public License (version 2) as
@@ -42,13 +42,17 @@ CubicPolyInterpolator::interpolate (double x)
   int hi = lo + 3;
 
   if (lo < -1) {
+#ifdef DEBUG
     sys_error (ERR_WARNING, "x=%f, out of range [CubicPolyInterpolator]", x);
+#endif
     return (0);
   } else if (lo == -1)  // linear interpolate at between x = 0 & 1
     return m_pdY[0] + x * (m_pdY[1] - m_pdY[0]);
 
   if (hi > m_n) {
+#ifdef DEBUG
     sys_error (ERR_WARNING, "x=%f, out of range [CubicPolyInterpolator]", x);
+#endif
     return (0);
   } else if (hi == m_n) {// linear interpolate between x = (n-2) and (n-1)
     double frac = x - (lo + 1);
@@ -116,7 +120,9 @@ CubicSplineInterpolator::interpolate (double x)
   int hi = lo + 1;
 
   if (lo < 0 || hi >= m_n) {
-    sys_error (ERR_SEVERE, "X range out of bounds [CubicSplineInterpolator::interpolate]");
+#ifdef DEBUG
+    sys_error (ERR_SEVERE, "x out of bounds [CubicSplineInterpolator::interpolate]");
+#endif
     return (0);
   }
 
@@ -128,5 +134,6 @@ CubicSplineInterpolator::interpolate (double x)
   return y;
 }
 
+