From 303b078b50bd3311a9c86fc256be3e9f2f334411 Mon Sep 17 00:00:00 2001 From: Bayes Nie Date: Sun, 24 May 2020 16:08:52 +0800 Subject: [PATCH] Fix few typos and alter a NULL to nullptr. Fix typos in docs/source/features.rst and examples/helloworld.cc. Alter a NULL to nullptr in include/ceres/autodiff_cost_function.h Change-Id: Ibcf00b6ef665ad6be9af14b3add2dd4f3852e7e6 --- docs/source/features.rst | 4 ++-- examples/helloworld.cc | 7 ++++--- include/ceres/autodiff_cost_function.h | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/docs/source/features.rst b/docs/source/features.rst index e71bd39db..348511d40 100644 --- a/docs/source/features.rst +++ b/docs/source/features.rst @@ -44,7 +44,7 @@ Why? solvers - dense QR and dense Cholesky factorization (using `Eigen`_ or `LAPACK`_) for dense problems, sparse Cholesky factorization (`SuiteSparse`_, `CXSparse`_ or `Eigen`_) for large - sparse problems custom Schur complement based dense, sparse, and + sparse problems, custom Schur complement based dense, sparse, and iterative linear solvers for `bundle adjustment`_ problems. - **Line Search Solvers** - When the problem size is so large that @@ -63,7 +63,7 @@ Why? * **Covariance estimation** - Evaluate the sensitivity/uncertainty of the solution by evaluating all or part of the covariance - matrix. Ceres is one of the few solvers that allows you to to do + matrix. Ceres is one of the few solvers that allows you to do this analysis at scale. * **Community** Since its release as an open source software, Ceres diff --git a/examples/helloworld.cc b/examples/helloworld.cc index 22dff5506..d5d546c6c 100644 --- a/examples/helloworld.cc +++ b/examples/helloworld.cc @@ -39,15 +39,16 @@ using ceres::AutoDiffCostFunction; using ceres::CostFunction; using ceres::Problem; -using ceres::Solver; using ceres::Solve; +using ceres::Solver; // A templated cost functor that implements the residual r = 10 - // x. The method operator() is templated so that we can then use an // automatic differentiation wrapper around it to generate its // derivatives. struct CostFunctor { - template bool operator()(const T* const x, T* residual) const { + template + bool operator()(const T* const x, T* residual) const { residual[0] = 10.0 - x[0]; return true; } @@ -68,7 +69,7 @@ int main(int argc, char** argv) { // auto-differentiation to obtain the derivative (jacobian). CostFunction* cost_function = new AutoDiffCostFunction(new CostFunctor); - problem.AddResidualBlock(cost_function, NULL, &x); + problem.AddResidualBlock(cost_function, nullptr, &x); // Run the solver! Solver::Options options; diff --git a/include/ceres/autodiff_cost_function.h b/include/ceres/autodiff_cost_function.h index 5605e0b5d..5e6e9c55d 100644 --- a/include/ceres/autodiff_cost_function.h +++ b/include/ceres/autodiff_cost_function.h @@ -54,7 +54,7 @@ // for a series of measurements, where there is an instance of the cost function // for each measurement k. // -// The actual cost added to the total problem is e^2, or (k - x'k)^2; however, +// The actual cost added to the total problem is e^2, or (k - x'y)^2; however, // the squaring is implicitly done by the optimization framework. // // To write an auto-differentiable cost function for the above model, first