diff --git a/docs/source/nnls_tutorial.rst b/docs/source/nnls_tutorial.rst index 6546ee78a..acbb9a174 100644 --- a/docs/source/nnls_tutorial.rst +++ b/docs/source/nnls_tutorial.rst @@ -78,7 +78,7 @@ function :math:`f(x) = 10 - x`: struct CostFunctor { template 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 @@ in the objective functor. Here is the code for evaluating struct F4 { template 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 @@ residual. There will be a residual for each observation. template 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 @@ The details of this camera model can be found the `Bundler homepage 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];