From e69bd2a206118c0262185baba7a6e710decbcb28 Mon Sep 17 00:00:00 2001 From: Rob Carroll Date: Mon, 31 Oct 2016 12:43:50 -0700 Subject: [PATCH] Add missing T() wrappers for constants. Needed for instantiation with Jet. Change-Id: I8ec07a844cc911a3c7f24c25797bd21c0bee07b5 --- include/ceres/jet.h | 2 +- include/ceres/rotation.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/ceres/jet.h b/include/ceres/jet.h index a10470729..be0ccb0b6 100644 --- a/include/ceres/jet.h +++ b/include/ceres/jet.h @@ -345,7 +345,7 @@ Jet operator/(T s, const Jet& g) { // Binary / with a scalar: x / s template inline Jet operator/(const Jet& f, T s) { - const T s_inverse = 1.0 / s; + const T s_inverse = T(1.0) / s; return Jet(f.a * s_inverse, f.v * s_inverse); } diff --git a/include/ceres/rotation.h b/include/ceres/rotation.h index b6a06f772..d05d19042 100644 --- a/include/ceres/rotation.h +++ b/include/ceres/rotation.h @@ -576,7 +576,7 @@ void AngleAxisRotatePoint(const T angle_axis[3], const T pt[3], T result[3]) { const T theta = sqrt(theta2); const T costheta = cos(theta); const T sintheta = sin(theta); - const T theta_inverse = 1.0 / theta; + const T theta_inverse = T(1.0) / theta; const T w[3] = { angle_axis[0] * theta_inverse, angle_axis[1] * theta_inverse,