** 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: interpolator.cpp,v 1.3 2001/03/21 21:45:31 kevin Exp $
**
** 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
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);
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);
}
+
+
+