Add missing T() wrappers for constants. Needed for instantiation with Jet<float,N>. Change-Id: I8ec07a844cc911a3c7f24c25797bd21c0bee07b5
diff --git a/include/ceres/jet.h b/include/ceres/jet.h index a104707..be0ccb0 100644 --- a/include/ceres/jet.h +++ b/include/ceres/jet.h
@@ -345,7 +345,7 @@ // Binary / with a scalar: x / s template<typename T, int N> inline Jet<T, N> operator/(const Jet<T, N>& f, T s) { - const T s_inverse = 1.0 / s; + const T s_inverse = T(1.0) / s; return Jet<T, N>(f.a * s_inverse, f.v * s_inverse); }
diff --git a/include/ceres/rotation.h b/include/ceres/rotation.h index b6a06f7..d05d190 100644 --- a/include/ceres/rotation.h +++ b/include/ceres/rotation.h
@@ -576,7 +576,7 @@ 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,