Remove conversions from a double to a Jet. There are overloaded operators supporting operations between a double and a Jet, so there is no need to convert a double to a Jet. Change-Id: I9cfcefb32c6b1a5ad716496b620d578871f0ff03
diff --git a/docs/source/nnls_tutorial.rst b/docs/source/nnls_tutorial.rst index 6546ee7..acbb9a1 100644 --- a/docs/source/nnls_tutorial.rst +++ b/docs/source/nnls_tutorial.rst
@@ -78,7 +78,7 @@ struct CostFunctor { template <typename T> bool operator()(const T* const x, T* residual) const { - residual[0] = T(10.0) - x[0]; + residual[0] = 10.0 - x[0]; return true; } }; @@ -338,7 +338,7 @@ struct F4 { template <typename T> bool operator()(const T* const x1, const T* const x4, T* residual) const { - residual[0] = T(sqrt(10.0)) * (x1[0] - x4[0]) * (x1[0] - x4[0]); + residual[0] = sqrt(10.0) * (x1[0] - x4[0]) * (x1[0] - x4[0]); return true; } }; @@ -471,7 +471,7 @@ template <typename T> bool operator()(const T* const m, const T* const c, T* residual) const { - residual[0] = T(y_) - exp(m[0] * T(x_) + c[0]); + residual[0] = y_ - exp(m[0] * x_ + c[0]); return true; } @@ -653,7 +653,7 @@ const T& l1 = camera[7]; const T& l2 = camera[8]; T r2 = xp*xp + yp*yp; - T distortion = T(1.0) + r2 * (l1 + l2 * r2); + T distortion = 1.0 + r2 * (l1 + l2 * r2); // Compute final projected point position. const T& focal = camera[6];