From 195d8d13a6a3962ac39ef7fcdcc6add0216eb8bc Mon Sep 17 00:00:00 2001 From: Sameer Agarwal Date: Tue, 6 Sep 2016 07:12:23 -0700 Subject: [PATCH] Remove two DCHECKs from CubicHermiteSpline. They were present as debugging checks but were causing problems with the build on 32bit i386 due to numerical cancellation issues, where x ~ -epsilon. Removing these checks only changes the behaviour in Debug mode. We are already handling such small negative numbers in production if they occur. All that this change does is to remove the crash. https://github.com/ceres-solver/ceres-solver/issues/212 Thanks to @NeroBurner and @debalance for reporting this. Change-Id: I66480e86d4fa0a4b621204f2ff44cc3ff8d01c04 --- include/ceres/cubic_interpolation.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/ceres/cubic_interpolation.h b/include/ceres/cubic_interpolation.h index 41bf627c4..53bbc3373 100644 --- a/include/ceres/cubic_interpolation.h +++ b/include/ceres/cubic_interpolation.h @@ -69,8 +69,6 @@ void CubicHermiteSpline(const Eigen::Matrix& p0, const double x, double* f, double* dfdx) { - DCHECK_GE(x, 0.0); - DCHECK_LE(x, 1.0); typedef Eigen::Matrix VType; const VType a = 0.5 * (-p0 + 3.0 * p1 - 3.0 * p2 + p3); const VType b = 0.5 * (2.0 * p0 - 5.0 * p1 + 4.0 * p2 - p3);