From d904f36776fc2a7edc361e965e64c90c42c8e361 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Thu, 5 Mar 2015 10:11:09 -0500 Subject: [PATCH] Fix MSVC compilation error MSVC 2013 compiler crashed when not specifying the template parameter of CubicHermiteSpline explicitly. Change-Id: I6ab79aea47f55373df5cb7b89e38f8b326ff21c9 --- include/ceres/cubic_interpolation.h | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/include/ceres/cubic_interpolation.h b/include/ceres/cubic_interpolation.h index 8298002d1..5e6b878dd 100644 --- a/include/ceres/cubic_interpolation.h +++ b/include/ceres/cubic_interpolation.h @@ -177,7 +177,8 @@ class CERES_EXPORT CubicInterpolator { p3 = 2 * p2 - p1; } - CubicHermiteSpline(p0, p1, p2, p3, x - n, f, dfdx); + CubicHermiteSpline(p0, p1, p2, p3, x - n, f, dfdx); + return true; } @@ -391,17 +392,23 @@ class CERES_EXPORT BiCubicInterpolator { // value and the horizontal derivative in each row. Eigen::Matrix f0, f1, f2, f3; Eigen::Matrix df0dc, df1dc, df2dc, df3dc; - CubicHermiteSpline(p00, p01, p02, p03, c - col, f0.data(), df0dc.data()); - CubicHermiteSpline(p10, p11, p12, p13, c - col, f1.data(), df1dc.data()); - CubicHermiteSpline(p20, p21, p22, p23, c - col, f2.data(), df2dc.data()); - CubicHermiteSpline(p30, p31, p32, p33, c - col, f3.data(), df3dc.data()); + + CubicHermiteSpline(p00, p01, p02, p03, c - col, + f0.data(), df0dc.data()); + CubicHermiteSpline(p10, p11, p12, p13, c - col, + f1.data(), df1dc.data()); + CubicHermiteSpline(p20, p21, p22, p23, c - col, + f2.data(), df2dc.data()); + CubicHermiteSpline(p30, p31, p32, p33, c - col, + f3.data(), df3dc.data()); // Interpolate vertically the interpolated value from each row and // compute the derivative along the columns. - CubicHermiteSpline(f0, f1, f2, f3, r - row, f, dfdr); + CubicHermiteSpline(f0, f1, f2, f3, r - row, f, dfdr); if (dfdc != NULL) { // Interpolate vertically the derivative along the columns. - CubicHermiteSpline(df0dc, df1dc, df2dc, df3dc, r - row, dfdc, NULL); + CubicHermiteSpline(df0dc, df1dc, df2dc, df3dc, + r - row, dfdc, NULL); } return true;