diff --git a/CMakeLists.txt b/CMakeLists.txt index 7f88fb48c..f6bf90509 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -498,7 +498,7 @@ if (MSVC) add_definitions("-D_USE_MATH_DEFINES") # Disable signed/unsigned int conversion warnings. add_compile_options("/wd4018" "/wd4267") - # Disable warning about using struct/class for the same symobl. + # Disable warning about using struct/class for the same symbol. add_compile_options("/wd4099") # Disable warning about the insecurity of using "std::copy". add_compile_options("/wd4996") @@ -609,7 +609,7 @@ add_compile_options( $<$:/wd4996>) if (CMAKE_VERSION VERSION_LESS 3.12) - # Disable the definiton of min/max macros within the project + # Disable the definition of min/max macros within the project if (WIN32) add_definitions (-DNOMINMAX) endif (WIN32) diff --git a/bazel/ceres.bzl b/bazel/ceres.bzl index e60865e3b..fad2754fc 100644 --- a/bazel/ceres.bzl +++ b/bazel/ceres.bzl @@ -184,7 +184,7 @@ def ceres_library(name, "-I" + internal, "-Wno-sign-compare", - # Disable warnings about deprecated interfraces while we are + # Disable warnings about deprecated interfaces while we are # transitioning from LocalParameterization to Manifolds. "-Wno-deprecated-declarations", ] + schur_eliminator_copts, diff --git a/cmake/iOS.cmake b/cmake/iOS.cmake index 1bb514ce4..0773d1300 100644 --- a/cmake/iOS.cmake +++ b/cmake/iOS.cmake @@ -257,7 +257,7 @@ endif() set(CMAKE_C_FLAGS "${XCODE_IOS_PLATFORM_VERSION_FLAGS} -fobjc-abi-version=2 -fobjc-arc ${CMAKE_C_FLAGS}") -# Hidden visibilty is required for C++ on iOS. +# Hidden visibility is required for C++ on iOS. set(CMAKE_CXX_FLAGS "${XCODE_IOS_PLATFORM_VERSION_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden -fobjc-abi-version=2 -fobjc-arc ${CMAKE_CXX_FLAGS}") set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG -O3 -fomit-frame-pointer -ffast-math ${CMAKE_CXX_FLAGS_RELEASE}") diff --git a/docs/source/automatic_derivatives.rst b/docs/source/automatic_derivatives.rst index e15e91172..26fceb046 100644 --- a/docs/source/automatic_derivatives.rst +++ b/docs/source/automatic_derivatives.rst @@ -298,7 +298,7 @@ we find that it is an indeterminate form at :math:`x_0 = 0, x_1 = There is no single solution to this problem. In some cases one needs to reason explicitly about the points where indeterminacy may occur -and use alternate expressions using `L'Hopital's rule +and use alternate expressions using `L'Hôpital's rule `_ (see for example some of the conversion routines in `rotation.h `_. In diff --git a/docs/source/gradient_solver.rst b/docs/source/gradient_solver.rst index dfe182265..cb27cd188 100644 --- a/docs/source/gradient_solver.rst +++ b/docs/source/gradient_solver.rst @@ -136,7 +136,7 @@ Solving Choices are ``ARMIJO`` and ``WOLFE`` (strong Wolfe conditions). Note that in order for the assumptions underlying the ``BFGS`` and ``LBFGS`` line search direction algorithms to be guaranteed to be - satisifed, the ``WOLFE`` line search should be used. + satisfied, the ``WOLFE`` line search should be used. .. member:: NonlinearConjugateGradientType GradientProblemSolver::Options::nonlinear_conjugate_gradient_type @@ -205,7 +205,7 @@ Solving low-sensitivity parameters. It can also reduce the robustness of the solution to errors in the Jacobians. -.. member:: LineSearchIterpolationType GradientProblemSolver::Options::line_search_interpolation_type +.. member:: LineSearchInterpolationType GradientProblemSolver::Options::line_search_interpolation_type Default: ``CUBIC`` diff --git a/docs/source/gradient_tutorial.rst b/docs/source/gradient_tutorial.rst index bd3ebf563..fb26cb76c 100644 --- a/docs/source/gradient_tutorial.rst +++ b/docs/source/gradient_tutorial.rst @@ -139,7 +139,7 @@ algorithm. If you are unable to use automatic differentiation for some reason -(say beacause you need to call an external library), then you can +(say because you need to call an external library), then you can use numeric differentiation. In that case the functor is defined as follows [#f2]_. diff --git a/docs/source/installation.rst b/docs/source/installation.rst index f0329f454..fa845c195 100644 --- a/docs/source/installation.rst +++ b/docs/source/installation.rst @@ -69,7 +69,7 @@ optional. For details on customizing the build process, see - `SuiteSparse `_ 4.0 or later. Needed for solving large sparse linear - systems. **Optional; strongly recomended for large scale bundle + systems. **Optional; strongly recommended for large scale bundle adjustment** .. NOTE :: diff --git a/docs/source/interfacing_with_autodiff.rst b/docs/source/interfacing_with_autodiff.rst index e7bcfd7a4..59bc79853 100644 --- a/docs/source/interfacing_with_autodiff.rst +++ b/docs/source/interfacing_with_autodiff.rst @@ -148,7 +148,7 @@ A function that returns its value and derivative ------------------------------------------------ Now suppose we are given a function :code:`ComputeDistortionValue` -thatis able to compute its value and optionally its Jacobian on demand +that is able to compute its value and optionally its Jacobian on demand and has the following signature: .. code-block:: c++ diff --git a/docs/source/nnls_covariance.rst b/docs/source/nnls_covariance.rst index c85bedd07..b86b5f616 100644 --- a/docs/source/nnls_covariance.rst +++ b/docs/source/nnls_covariance.rst @@ -166,7 +166,7 @@ cases. moderately fast algorithm suitable for small to medium sized matrices. For best performance we recommend using ``SuiteSparseQR`` which is enabled by setting - :member:`Covaraince::Options::sparse_linear_algebra_library_type` + :member:`Covariance::Options::sparse_linear_algebra_library_type` to ``SUITE_SPARSE``. ``SPARSE_QR`` cannot compute the covariance if the @@ -238,7 +238,7 @@ cases. .. math:: \frac{\sigma_{\text{min}}}{\sigma_{\text{max}}} < \sqrt{\text{min_reciprocal_condition_number}} where :math:`\sigma_{\text{min}}` and - :math:`\sigma_{\text{max}}` are the minimum and maxiumum + :math:`\sigma_{\text{max}}` are the minimum and maximum singular values of :math:`J` respectively. 2. ``SPARSE_QR`` diff --git a/docs/source/nnls_modeling.rst b/docs/source/nnls_modeling.rst index c6b7987ce..832e292de 100644 --- a/docs/source/nnls_modeling.rst +++ b/docs/source/nnls_modeling.rst @@ -1582,7 +1582,7 @@ dimensional manifold represented as unit norm 4-vectors, i.e. is the ambient space representation. Here :math:`q_0` is the scalar part. :math:`q_1` is the coefficient of :math:`i`, :math:`q_2` is the -coefficient of :math:`j`, and :math:`q_3` is the coeffcient of +coefficient of :math:`j`, and :math:`q_3` is the coefficient of :math:`k`. Where: .. math:: @@ -2113,7 +2113,7 @@ manifold that embedded in :math:`n` dimensional space where the scale of the vector does not matter, i.e., elements of the projective space :math:`\mathbb{P}^{n-1}`. It assumes that the last coordinate of the :math:`n`-vector is the *scalar* component of the -homogenous vector, i.e., *finite* points in this representation are +homogeneous vector, i.e., *finite* points in this representation are those for which the *scalar* component is non-zero. Further, ``HomogeneousVectorParameterization::Plus`` preserves the @@ -2235,7 +2235,7 @@ quaternion, a local parameterization can be constructed as q_delta[3] = delta[2]; } - Quaternionproduct(q_delta, x, x_plus_delta); + QuaternionProduct(q_delta, x, x_plus_delta); return true; } }; @@ -2262,7 +2262,7 @@ quaternion, a local parameterization can be constructed as :class:`LocalParameterization` to :class:`Manifolds` in the Ceres Solver API. During this period, :class:`Problem` will support using both :class:`Manifold` and - :class:`LocalParameterization` objects interchangably. In + :class:`LocalParameterization` objects interchangeably. In particular, adding a :class:`LocalParameterization` to a parameter block is the same as adding a :class:`Manifold` to that parameter block. For methods in the API affected by this @@ -2551,7 +2551,7 @@ quaternion, a local parameterization can be constructed as Repeated calls with the same arguments are ignored. Repeated calls with the same double pointer but a different size results in a crash - (unless :member:`Solver::Options::diable_all_safety_checks` is set to ``true``). + (unless :member:`Solver::Options::disable_all_safety_checks` is set to ``true``). Repeated calls with the same double pointer and size but different :class:`LocalParameterization` is equivalent to calling @@ -2577,7 +2577,7 @@ quaternion, a local parameterization can be constructed as Repeated calls with the same arguments are ignored. Repeated calls with the same double pointer but a different size results in a crash - (unless :member:`Solver::Options::diable_all_safety_checks` is set to true). + (unless :member:`Solver::Options::disable_all_safety_checks` is set to true). Repeated calls with the same double pointer and size but different :class:`Manifold` is equivalent to calling `SetManifold(manifold)`, @@ -2680,7 +2680,7 @@ quaternion, a local parameterization can be constructed as It is acceptable to set the same :class:`LocalParameterization` for multiple parameter blocks; the Problem destructor is careful to - delete :class:`LocalParamaterizations` only once. + delete :class:`LocalParameterizations` only once. .. function:: LocalParameterization* Problem::GetParameterization(const double* values) const diff --git a/docs/source/nnls_solving.rst b/docs/source/nnls_solving.rst index a3225dbf6..ce10a11d9 100644 --- a/docs/source/nnls_solving.rst +++ b/docs/source/nnls_solving.rst @@ -493,7 +493,7 @@ substantial savings in time and memory for large sparse problems. Ceres uses the sparse Cholesky factorization routines in Professor Tim Davis' ``SuiteSparse`` or ``CXSparse`` packages [Chen]_ or the sparse Cholesky factorization algorithm in ``Eigen`` (which -incidently is a port of the algorithm implemented inside ``CXSparse``) +incidentally is a port of the algorithm implemented inside ``CXSparse``) .. _section-cgnr: @@ -921,7 +921,7 @@ elimination group [LiSaad]_. Choices are ``ARMIJO`` and ``WOLFE`` (strong Wolfe conditions). Note that in order for the assumptions underlying the ``BFGS`` and ``LBFGS`` line search direction algorithms to be guaranteed to be - satisifed, the ``WOLFE`` line search should be used. + satisfied, the ``WOLFE`` line search should be used. .. member:: NonlinearConjugateGradientType Solver::Options::nonlinear_conjugate_gradient_type @@ -1332,7 +1332,7 @@ elimination group [LiSaad]_. dense linear algebra library which may or may not be available. This setting affects the ``DENSE_QR``, ``DENSE_NORMAL_CHOLESKY`` - and ``DENSE_SCHUR`` solvers. For small to moderate sized probem + and ``DENSE_SCHUR`` solvers. For small to moderate sized problem ``EIGEN`` is a fine choice but for large problems, an optimized ``LAPACK + BLAS`` or ``CUDA`` implementation can make a substantial difference in performance. diff --git a/docs/source/numerical_derivatives.rst b/docs/source/numerical_derivatives.rst index 57b46bf36..609c84b69 100644 --- a/docs/source/numerical_derivatives.rst +++ b/docs/source/numerical_derivatives.rst @@ -326,7 +326,7 @@ starting with a fairly large step size :math:`h = 0.01`, we get: Compared to the *correct* value :math:`Df(1.0) = 140.73773557129658`, :math:`A(5, 1)` has a relative error of :math:`10^{-13}`. For comparison, the relative error for the central difference formula with -the same stepsize (:math:`0.01/2^4 = 0.000625`) is :math:`10^{-5}`. +the same step size (:math:`0.01/2^4 = 0.000625`) is :math:`10^{-5}`. The above tableau is the basis of Ridders' method for numeric differentiation. The full implementation is an adaptive scheme that diff --git a/examples/bal_problem.cc b/examples/bal_problem.cc index d59bfed74..99bc07547 100644 --- a/examples/bal_problem.cc +++ b/examples/bal_problem.cc @@ -78,7 +78,7 @@ BALProblem::BALProblem(const std::string& filename, bool use_quaternions) { return; }; - // This wil die horribly on invalid files. Them's the breaks. + // This will die horribly on invalid files. Them's the breaks. FscanfOrDie(fptr, "%d", &num_cameras_); FscanfOrDie(fptr, "%d", &num_points_); FscanfOrDie(fptr, "%d", &num_observations_); diff --git a/examples/bundle_adjuster.cc b/examples/bundle_adjuster.cc index 5cab6937c..d03c2ff59 100644 --- a/examples/bundle_adjuster.cc +++ b/examples/bundle_adjuster.cc @@ -120,7 +120,7 @@ DEFINE_double(point_sigma, 0.0, "Standard deviation of the point " "perturbation."); DEFINE_int32(random_seed, 38401, "Random seed used to set the state " "of the pseudo random number generator used to generate " - "the pertubations."); + "the perturbations."); DEFINE_bool(line_search, false, "Use a line search instead of trust region " "algorithm."); DEFINE_bool(mixed_precision_solves, false, "Use mixed precision solves."); @@ -298,7 +298,7 @@ void BuildProblem(BALProblem* bal_problem, Problem* problem) { LossFunction* loss_function = CERES_GET_FLAG(FLAGS_robustify) ? new HuberLoss(1.0) : nullptr; - // Each observation correponds to a pair of a camera and a point + // Each observation corresponds to a pair of a camera and a point // which are identified by camera_index()[i] and point_index()[i] // respectively. double* camera = diff --git a/examples/denoising.cc b/examples/denoising.cc index a62b447ac..6cb08d169 100644 --- a/examples/denoising.cc +++ b/examples/denoising.cc @@ -33,7 +33,7 @@ // Note that for good denoising results the weighting between the data term // and the Fields of Experts term needs to be adjusted. This is discussed // in [1]. This program assumes Gaussian noise. The noise model can be changed -// by substituing another function for QuadraticCostFunction. +// by substituting another function for QuadraticCostFunction. // // [1] S. Roth and M.J. Black. "Fields of Experts." International Journal of // Computer Vision, 82(2):205--229, 2009. diff --git a/examples/fields_of_experts.cc b/examples/fields_of_experts.cc index 81dd9370c..01fa17a6a 100644 --- a/examples/fields_of_experts.cc +++ b/examples/fields_of_experts.cc @@ -28,7 +28,7 @@ // // Author: strandmark@google.com (Petter Strandmark) // -// Class for loading the data required for descibing a Fields of Experts (FoE) +// Class for loading the data required for describing a Fields of Experts (FoE) // model. #include "fields_of_experts.h" diff --git a/examples/fields_of_experts.h b/examples/fields_of_experts.h index 65242a901..25e3ff132 100644 --- a/examples/fields_of_experts.h +++ b/examples/fields_of_experts.h @@ -28,7 +28,7 @@ // // Author: strandmark@google.com (Petter Strandmark) // -// Class for loading the data required for descibing a Fields of Experts (FoE) +// Class for loading the data required for describing a Fields of Experts (FoE) // model. The Fields of Experts regularization consists of terms of the type // // alpha * log(1 + (1/2)*sum(F .* X)^2), diff --git a/examples/libmv_bundle_adjuster.cc b/examples/libmv_bundle_adjuster.cc index 4f004069c..dd3687508 100644 --- a/examples/libmv_bundle_adjuster.cc +++ b/examples/libmv_bundle_adjuster.cc @@ -60,7 +60,7 @@ // Image number shall be greater or equal to zero. Order of cameras does not // matter and gaps are possible. // -// Every 3D point is decribed by: +// Every 3D point is described by: // // - Track number point belongs to (single 4 bytes integer value). // - 3D position vector, 3-component vector of float values. diff --git a/examples/libmv_homography.cc b/examples/libmv_homography.cc index b795ab1ff..7bfcd8b50 100644 --- a/examples/libmv_homography.cc +++ b/examples/libmv_homography.cc @@ -380,10 +380,10 @@ int main(int argc, char** argv) { Mat x2 = x1; for (int i = 0; i < x2.cols(); ++i) { - Vec3 homogenous_x1 = Vec3(x1(0, i), x1(1, i), 1.0); - Vec3 homogenous_x2 = homography_matrix * homogenous_x1; - x2(0, i) = homogenous_x2(0) / homogenous_x2(2); - x2(1, i) = homogenous_x2(1) / homogenous_x2(2); + Vec3 homogeneous_x1 = Vec3(x1(0, i), x1(1, i), 1.0); + Vec3 homogeneous_x2 = homography_matrix * homogeneous_x1; + x2(0, i) = homogeneous_x2(0) / homogeneous_x2(2); + x2(1, i) = homogeneous_x2(1) / homogeneous_x2(2); // Apply some noise so algebraic estimation is not good enough. x2(0, i) += static_cast(rand() % 1000) / 5000.0; diff --git a/examples/nist.cc b/examples/nist.cc index 593feee5b..05c15b2f4 100644 --- a/examples/nist.cc +++ b/examples/nist.cc @@ -117,7 +117,7 @@ DEFINE_int32(max_line_search_restarts, "Maximum number of restarts of line search direction algorithm."); DEFINE_string(line_search_interpolation, "cubic", - "Degree of polynomial aproximation in line search, choices are: " + "Degree of polynomial approximation in line search, choices are: " "bisection, quadratic & cubic."); DEFINE_int32(lbfgs_rank, 20, @@ -179,7 +179,7 @@ void SplitStringUsingChar(const string& full, } else { const char* start = p; while (++p != end && *p != delim) { - // Skip to the next occurence of the delimiter. + // Skip to the next occurrence of the delimiter. } *it++ = string(start, p - start); } @@ -250,7 +250,7 @@ class NISTProblem { final_parameters_(0, parameter_id) = atof(pieces[2 + kNumTries].c_str()); } - // Certfied cost + // Certified cost SkipLines(ifs, 1); GetAndSplitLine(ifs, &pieces); certified_cost_ = atof(pieces[4].c_str()) / 2.0; diff --git a/examples/robot_pose_mle.cc b/examples/robot_pose_mle.cc index 5fb4749eb..c199b89fa 100644 --- a/examples/robot_pose_mle.cc +++ b/examples/robot_pose_mle.cc @@ -50,7 +50,7 @@ // // There are two types of residuals in this problem: // 1) The OdometryConstraint residual, that accounts for the odometry readings -// between successive pose estimatess of the robot. +// between successive pose estimates of the robot. // 2) The RangeConstraint residual, that accounts for the errors in the observed // range readings from each pose. // @@ -97,14 +97,14 @@ // timesteps 0 to i for that variable, both inclusive. // // Bayes' rule is used to derive eq. 3 from 2, and the independence of -// odometry observations and range readings is expolited to derive 4 from 3. +// odometry observations and range readings is exploited to derive 4 from 3. // // Thus, the Belief, up to scale, is factored as a product of a number of // terms, two for each pose, where for each pose term there is one term for the // range reading, P(y_i | u*_(0:i) and one term for the odometry reading, // P(u*_i | u_i) . Note that the term for the range reading is dependent on all // odometry values u*_(0:i), while the odometry term, P(u*_i | u_i) depends only -// on a single value, u_i. Both the range reading as well as odoemtry +// on a single value, u_i. Both the range reading as well as odometry // probability terms are modeled as the Normal distribution, and have the form: // // p(x) \propto \exp{-((x - x_mean) / x_stddev)^2} @@ -123,7 +123,7 @@ // variable, and will be computed by an AutoDiffCostFunction, while the term // for the range reading will depend on all previous odometry observations, and // will be computed by a DynamicAutoDiffCostFunction since the number of -// odoemtry observations will only be known at run time. +// odometry observations will only be known at run time. #include #include diff --git a/examples/slam/common/read_g2o.h b/examples/slam/common/read_g2o.h index 18c0a20d5..6583c6dca 100644 --- a/examples/slam/common/read_g2o.h +++ b/examples/slam/common/read_g2o.h @@ -59,7 +59,7 @@ bool ReadVertex(std::ifstream* infile, return true; } -// Reads the contraints between two vertices in the pose graph +// Reads the constraints between two vertices in the pose graph template void ReadConstraint(std::ifstream* infile, std::vector* constraints) { diff --git a/include/ceres/cost_function_to_functor.h b/include/ceres/cost_function_to_functor.h index 08a8050c5..127a61566 100644 --- a/include/ceres/cost_function_to_functor.h +++ b/include/ceres/cost_function_to_functor.h @@ -120,7 +120,7 @@ class CostFunctionToFunctor { if (parameter_block_sizes.size() == num_parameter_blocks) { for (int block = 0; block < num_parameter_blocks; ++block) { CHECK_EQ(ParameterDims::GetDim(block), parameter_block_sizes[block]) - << "Parameter block size missmatch. The specified static parameter " + << "Parameter block size mismatch. The specified static parameter " "block dimension does not match the one from the cost function."; } } diff --git a/include/ceres/covariance.h b/include/ceres/covariance.h index 00d00bde2..612e036fc 100644 --- a/include/ceres/covariance.h +++ b/include/ceres/covariance.h @@ -280,7 +280,7 @@ class CERES_EXPORT Covariance { // // min_sigma / max_sigma < sqrt(min_reciprocal_condition_number) // - // where min_sigma and max_sigma are the minimum and maxiumum + // where min_sigma and max_sigma are the minimum and maximum // singular values of J respectively. // // 2. SPARSE_QR diff --git a/include/ceres/cubic_interpolation.h b/include/ceres/cubic_interpolation.h index 3ca6b11b4..4704bffa1 100644 --- a/include/ceres/cubic_interpolation.h +++ b/include/ceres/cubic_interpolation.h @@ -368,7 +368,7 @@ class BiCubicInterpolator { // // f001, f002, f011, f012, ... // -// A commonly occuring example are color images (RGB) where the three +// A commonly occurring example are color images (RGB) where the three // channels are stored interleaved. // // If kInterleaved = false, then it is stored as diff --git a/include/ceres/gradient_problem.h b/include/ceres/gradient_problem.h index b6a8b8674..6a36bea2c 100644 --- a/include/ceres/gradient_problem.h +++ b/include/ceres/gradient_problem.h @@ -94,7 +94,7 @@ class FirstOrderFunction; // NOTE: We are currently in the process of transitioning from // LocalParameterization to Manifolds in the Ceres API. During this period, // GradientProblem will support using both Manifold and LocalParameterization -// objects interchangably. For methods in the API affected by this change, see +// objects interchangeably. For methods in the API affected by this change, see // their documentation below. class CERES_EXPORT GradientProblem { public: diff --git a/include/ceres/internal/sphere_manifold_functions.h b/include/ceres/internal/sphere_manifold_functions.h index 934d86a7a..f9af5ec15 100644 --- a/include/ceres/internal/sphere_manifold_functions.h +++ b/include/ceres/internal/sphere_manifold_functions.h @@ -115,18 +115,18 @@ inline void ComputeSphereManifoldMinus( AmbientSpaceDim == Eigen::Dynamic ? Eigen::Dynamic : AmbientSpaceDim - 1; using AmbientVector = Eigen::Matrix; - const int tanget_size = v.size() - 1; + const int tangent_size = v.size() - 1; const AmbientVector hy = ApplyHouseholderVector(y, v, beta) / x.norm(); // Calculate y - x. See B.2 p.25 equation (108). - double y_last = hy[tanget_size]; - double hy_norm = hy.template head(tanget_size).norm(); + double y_last = hy[tangent_size]; + double hy_norm = hy.template head(tangent_size).norm(); if (hy_norm == 0.0) { y_minus_x->setZero(); } else { *y_minus_x = 2.0 * std::atan2(hy_norm, y_last) / hy_norm * - hy.template head(tanget_size); + hy.template head(tangent_size); } } diff --git a/include/ceres/jet.h b/include/ceres/jet.h index 3f5311be5..2aefdc609 100644 --- a/include/ceres/jet.h +++ b/include/ceres/jet.h @@ -802,7 +802,7 @@ template inline Jet erf(const Jet& x) { // We evaluate the constant as follows: // 2 / sqrt(pi) = 1 / sqrt(atan(1.)) - // On POSIX sytems it is defined as M_2_SQRTPI, but this is not + // On POSIX systems it is defined as M_2_SQRTPI, but this is not // portable and the type may not be T. The above expression // evaluates to full precision with IEEE arithmetic and, since it's // constant, the compiler can generate exactly the same code. gcc diff --git a/include/ceres/problem.h b/include/ceres/problem.h index 819fa454b..cbb1dff30 100644 --- a/include/ceres/problem.h +++ b/include/ceres/problem.h @@ -122,7 +122,7 @@ using ResidualBlockId = internal::ResidualBlock*; // NOTE: We are currently in the process of transitioning from // LocalParameterization to Manifolds in the Ceres API. During this period, // Problem will support using both Manifold and LocalParameterization objects -// interchangably. In particular, adding a LocalParameterization to a parameter +// interchangeably. In particular, adding a LocalParameterization to a parameter // block is the same as adding a Manifold to that parameter block. For methods // in the API affected by this change, see their documentation below. class CERES_EXPORT Problem { @@ -276,7 +276,7 @@ class CERES_EXPORT Problem { // // Repeated calls with the same arguments are ignored. Repeated calls // with the same double pointer but a different size results in a crash - // (unless Solver::Options::diable_all_safety_checks is set to true). + // (unless Solver::Options::disable_all_safety_checks is set to true). // // Repeated calls with the same double pointer and size but different // LocalParameterization is equivalent to calling @@ -308,7 +308,7 @@ class CERES_EXPORT Problem { // // Repeated calls with the same arguments are ignored. Repeated calls // with the same double pointer but a different size results in a crash - // (unless Solver::Options::diable_all_safety_checks is set to true). + // (unless Solver::Options::disable_all_safety_checks is set to true). // // Repeated calls with the same double pointer and size but different Manifold // is equivalent to calling SetManifold(manifold), i.e., any previously @@ -377,7 +377,7 @@ class CERES_EXPORT Problem { // // It is acceptable to set the same LocalParameterization for multiple // parameter blocks; the destructor is careful to delete - // LocalParamaterizations only once. + // LocalParameterizations only once. // // NOTE: // ---- @@ -493,7 +493,7 @@ class CERES_EXPORT Problem { "instead.") int ParameterBlockLocalSize(const double* values) const; - // The dimenion of the tangent space of the LocalParameterization or Manifold + // The dimension of the tangent space of the LocalParameterization or Manifold // for the parameter block. If there is no LocalParameterization or Manifold // associated with this parameter block, then ParameterBlockTangentSize = // ParameterBlockSize. diff --git a/include/ceres/rotation.h b/include/ceres/rotation.h index 51079901a..8cdd3fca5 100644 --- a/include/ceres/rotation.h +++ b/include/ceres/rotation.h @@ -60,7 +60,7 @@ namespace ceres { // // the expression M(i, j) is equivalent to // -// arrary[i * row_stride + j * col_stride] +// array[i * row_stride + j * col_stride] // // Conversion functions to and from rotation matrices accept // MatrixAdapters to permit using row-major and column-major layouts, diff --git a/include/ceres/tiny_solver_autodiff_function.h b/include/ceres/tiny_solver_autodiff_function.h index 3e3675ff0..b961295ed 100644 --- a/include/ceres/tiny_solver_autodiff_function.h +++ b/include/ceres/tiny_solver_autodiff_function.h @@ -171,7 +171,7 @@ class TinySolverAutoDiffFunction { const CostFunctor& cost_functor_; // The number of residuals at runtime. - // This will be overriden if NUM_RESIDUALS == Eigen::Dynamic. + // This will be overridden if NUM_RESIDUALS == Eigen::Dynamic. int num_residuals_ = kNumResiduals; // To evaluate the cost function with jets, temporary storage is needed. These diff --git a/internal/ceres/accelerate_sparse.cc b/internal/ceres/accelerate_sparse.cc index 74adfaf9a..53ba3a0cf 100644 --- a/internal/ceres/accelerate_sparse.cc +++ b/internal/ceres/accelerate_sparse.cc @@ -61,7 +61,7 @@ const char* SparseStatusToString(SparseStatus_t status) { CASESTR(SparseParameterError); CASESTR(SparseStatusReleased); default: - return "UKNOWN"; + return "UNKNOWN"; } } } // namespace. diff --git a/internal/ceres/block_jacobian_writer.h b/internal/ceres/block_jacobian_writer.h index 4ed0e66dc..00dcb36eb 100644 --- a/internal/ceres/block_jacobian_writer.h +++ b/internal/ceres/block_jacobian_writer.h @@ -50,7 +50,7 @@ class BlockEvaluatePreparer; class Program; class SparseMatrix; -// TODO(sameeragarwal): This class needs documemtation. +// TODO(sameeragarwal): This class needs documentation. class CERES_NO_EXPORT BlockJacobianWriter { public: BlockJacobianWriter(const Evaluator::Options& options, Program* program); diff --git a/internal/ceres/compressed_row_sparse_matrix.cc b/internal/ceres/compressed_row_sparse_matrix.cc index 7a08c6f3f..40f8d14da 100644 --- a/internal/ceres/compressed_row_sparse_matrix.cc +++ b/internal/ceres/compressed_row_sparse_matrix.cc @@ -48,7 +48,7 @@ using std::vector; namespace { // Helper functor used by the constructor for reordering the contents -// of a TripletSparseMatrix. This comparator assumes thay there are no +// of a TripletSparseMatrix. This comparator assumes that there are no // duplicates in the pair of arrays rows and cols, i.e., there is no // indices i and j (not equal to each other) s.t. // diff --git a/internal/ceres/compressed_row_sparse_matrix.h b/internal/ceres/compressed_row_sparse_matrix.h index 3d7d385b1..522734c2c 100644 --- a/internal/ceres/compressed_row_sparse_matrix.h +++ b/internal/ceres/compressed_row_sparse_matrix.h @@ -165,7 +165,7 @@ class CERES_NO_EXPORT CompressedRowSparseMatrix : public SparseMatrix { // given bounds. // // Then we walk the block structure of the resulting matrix, and with - // probability block_density detemine whether they are structurally + // probability block_density determine whether they are structurally // zero or not. If the answer is no, then we generate entries for the // block which are distributed normally. struct RandomMatrixOptions { @@ -209,7 +209,7 @@ class CERES_NO_EXPORT CompressedRowSparseMatrix : public SparseMatrix { StorageType storage_type_; // If the matrix has an underlying block structure, then it can also - // carry with it row and column block sizes. This is auxilliary and + // carry with it row and column block sizes. This is auxiliary and // optional information for use by algorithms operating on the // matrix. The class itself does not make use of this information in // any way. diff --git a/internal/ceres/conjugate_gradients_solver.h b/internal/ceres/conjugate_gradients_solver.h index 1ea964639..c5efac734 100644 --- a/internal/ceres/conjugate_gradients_solver.h +++ b/internal/ceres/conjugate_gradients_solver.h @@ -43,8 +43,8 @@ namespace ceres::internal { class LinearOperator; // This class implements the now classical Conjugate Gradients -// algorithm of Hestenes & Stiefel for solving postive semidefinite -// linear sytems. Optionally it can use a preconditioner also to +// algorithm of Hestenes & Stiefel for solving positive semidefinite +// linear systems. Optionally it can use a preconditioner also to // reduce the condition number of the linear system and improve the // convergence rate. Modern references for Conjugate Gradients are the // books by Yousef Saad and Trefethen & Bau. This implementation of CG diff --git a/internal/ceres/covariance_impl.cc b/internal/ceres/covariance_impl.cc index 9e1bfaa9f..15a454f1d 100644 --- a/internal/ceres/covariance_impl.cc +++ b/internal/ceres/covariance_impl.cc @@ -189,7 +189,7 @@ bool CovarianceImpl::GetCovarianceBlockInTangentOrAmbientSpace( const int* cols_begin = cols + rows[row_begin]; // The only part that requires work is walking the compressed column - // vector to determine where the set of columns correspnding to the + // vector to determine where the set of columns corresponding to the // covariance block begin. int offset = 0; while (cols_begin[offset] != col_begin && offset < row_size) { diff --git a/internal/ceres/covariance_test.cc b/internal/ceres/covariance_test.cc index 84afced79..ad9fe0a51 100644 --- a/internal/ceres/covariance_test.cc +++ b/internal/ceres/covariance_test.cc @@ -1161,7 +1161,7 @@ TEST_F(CovarianceTest, TruncatedRank) { // -15 -18 3 6 13 0 // 6 -4 0 0 0 29 - // 3.4142 is the smallest eigen value of J'J. The following matrix + // 3.4142 is the smallest eigenvalue of J'J. The following matrix // was obtained by dropping the eigenvector corresponding to this // eigenvalue. // clang-format off diff --git a/internal/ceres/dense_cholesky.cc b/internal/ceres/dense_cholesky.cc index dec0de10a..bd20e8cbe 100644 --- a/internal/ceres/dense_cholesky.cc +++ b/internal/ceres/dense_cholesky.cc @@ -268,7 +268,7 @@ LinearSolverTerminationType CUDADenseCholesky::Solve(const double* rhs, double* solution, std::string* message) { if (factorize_result_ != LinearSolverTerminationType::LINEAR_SOLVER_SUCCESS) { - *message = "Factorize did not complete succesfully previously."; + *message = "Factorize did not complete successfully previously."; return factorize_result_; } rhs_.CopyToGpuAsync(rhs, num_cols_, stream_); diff --git a/internal/ceres/dense_cholesky.h b/internal/ceres/dense_cholesky.h index 5866d38d5..d56107914 100644 --- a/internal/ceres/dense_cholesky.h +++ b/internal/ceres/dense_cholesky.h @@ -170,7 +170,7 @@ class CERES_NO_EXPORT CUDADenseCholesky final : public DenseCholesky { // Required for error handling with cuSOLVER. CudaBuffer error_; // Cache the result of Factorize to ensure that when Solve is called, the - // factiorization of lhs is valid. + // factorization of lhs is valid. LinearSolverTerminationType factorize_result_ = LINEAR_SOLVER_FATAL_ERROR; }; diff --git a/internal/ceres/dense_qr.cc b/internal/ceres/dense_qr.cc index 8d0236899..b2d9bb814 100644 --- a/internal/ceres/dense_qr.cc +++ b/internal/ceres/dense_qr.cc @@ -98,7 +98,7 @@ extern "C" void dormqr_(const char* side, const char* trans, const int* m, // a is a column major lda x n. // b is a column major matrix of ldb x nrhs // -// info = 0 succesful. +// info = 0 successful. // = -i < 0 i^th argument is an illegal value. // = i > 0, i^th diagonal element of A is zero. extern "C" void dtrtrs_(const char* uplo, const char* trans, const char* diag, @@ -382,7 +382,7 @@ LinearSolverTerminationType CUDADenseQR::Solve(const double* rhs, double* solution, std::string* message) { if (factorize_result_ != LinearSolverTerminationType::LINEAR_SOLVER_SUCCESS) { - *message = "Factorize did not complete succesfully previously."; + *message = "Factorize did not complete successfully previously."; return factorize_result_; } rhs_.CopyToGpuAsync(rhs, num_rows_, stream_); diff --git a/internal/ceres/dynamic_compressed_row_finalizer.h b/internal/ceres/dynamic_compressed_row_finalizer.h index ebb383992..56e81eee7 100644 --- a/internal/ceres/dynamic_compressed_row_finalizer.h +++ b/internal/ceres/dynamic_compressed_row_finalizer.h @@ -28,8 +28,8 @@ // // Author: richie.stebbing@gmail.com (Richard Stebbing) -#ifndef CERES_INTERNAL_DYNAMIC_COMPRESED_ROW_FINALIZER_H_ -#define CERES_INTERNAL_DYNAMIC_COMPRESED_ROW_FINALIZER_H_ +#ifndef CERES_INTERNAL_DYNAMIC_COMPRESSED_ROW_FINALIZER_H_ +#define CERES_INTERNAL_DYNAMIC_COMPRESSED_ROW_FINALIZER_H_ #include "ceres/casts.h" #include "ceres/dynamic_compressed_row_sparse_matrix.h" @@ -47,4 +47,4 @@ struct CERES_NO_EXPORT DynamicCompressedRowJacobianFinalizer { } // namespace ceres::internal -#endif // CERES_INTERNAL_DYNAMIC_COMPRESED_ROW_FINALISER_H_ +#endif // CERES_INTERNAL_DYNAMIC_COMPRESSED_ROW_FINALISER_H_ diff --git a/internal/ceres/dynamic_compressed_row_jacobian_writer.h b/internal/ceres/dynamic_compressed_row_jacobian_writer.h index 42ac05bb6..010d5eeb0 100644 --- a/internal/ceres/dynamic_compressed_row_jacobian_writer.h +++ b/internal/ceres/dynamic_compressed_row_jacobian_writer.h @@ -67,7 +67,7 @@ class CERES_NO_EXPORT DynamicCompressedRowJacobianWriter { // Write only the non-zero jacobian entries for a residual block // (specified by `residual_id`) into `base_jacobian`, starting at the row - // specifed by `residual_offset`. + // specified by `residual_offset`. // // This method is thread-safe over residual blocks (each `residual_id`). void Write(int residual_id, diff --git a/internal/ceres/dynamic_compressed_row_sparse_matrix.h b/internal/ceres/dynamic_compressed_row_sparse_matrix.h index 0094f7e61..65a309db0 100644 --- a/internal/ceres/dynamic_compressed_row_sparse_matrix.h +++ b/internal/ceres/dynamic_compressed_row_sparse_matrix.h @@ -52,7 +52,7 @@ namespace ceres::internal { class CERES_NO_EXPORT DynamicCompressedRowSparseMatrix final : public CompressedRowSparseMatrix { public: - // Set the number of rows and columns for the underlyig + // Set the number of rows and columns for the underlying // `CompressedRowSparseMatrix` and set the initial number of maximum non-zero // entries. Note that following the insertion of entries, when `Finalize` // is called the number of non-zeros is determined and all internal @@ -73,7 +73,7 @@ class CERES_NO_EXPORT DynamicCompressedRowSparseMatrix final // Insert an entry at a given row and column position. This method is // thread-safe across rows i.e. different threads can insert values - // simultaneously into different rows. It should be emphasised that this + // simultaneously into different rows. It should be emphasized that this // method always inserts a new entry and does not check for existing // entries at the specified row and column position. Duplicate entries // for a given row and column position will result in undefined diff --git a/internal/ceres/function_sample.h b/internal/ceres/function_sample.h index 85074c250..ce3bc0646 100644 --- a/internal/ceres/function_sample.h +++ b/internal/ceres/function_sample.h @@ -82,7 +82,7 @@ struct CERES_NO_EXPORT FunctionSample { // // where d is the search direction. double gradient; - // True if the evaluation of the gradient was sucessful and the + // True if the evaluation of the gradient was successful and the // value is a finite number. bool gradient_is_valid; }; diff --git a/internal/ceres/gradient_checker_test.cc b/internal/ceres/gradient_checker_test.cc index 208a0a7ea..fcc48929b 100644 --- a/internal/ceres/gradient_checker_test.cc +++ b/internal/ceres/gradient_checker_test.cc @@ -331,7 +331,7 @@ class LinearCostFunction : public CostFunction { } /// Add offset to the given Jacobian before returning it from Evaluate(), - /// thus introducing an error in the comutation. + /// thus introducing an error in the computation. void SetJacobianOffset(size_t index, Matrix offset) { CHECK_LT(index, residual_J_params_.size()); CHECK_EQ(residual_J_params_[index].rows(), offset.rows()); diff --git a/internal/ceres/gradient_problem_test.cc b/internal/ceres/gradient_problem_test.cc index a3d18e79d..123ec75c8 100644 --- a/internal/ceres/gradient_problem_test.cc +++ b/internal/ceres/gradient_problem_test.cc @@ -76,7 +76,7 @@ TEST(GradientProblem, EvaluationWithoutParameterizationOrGradient) { EXPECT_EQ(x * x, cost); } -TEST(GradientProblem, EvalutaionWithParameterizationAndNoGradient) { +TEST(GradientProblem, EvaluationWithParameterizationAndNoGradient) { ceres::GradientProblem problem(new QuadraticTestFunction(), new IdentityParameterization(1)); double x = 7.0; @@ -104,7 +104,7 @@ TEST(GradientProblem, EvaluationWithParameterizationAndWithGradient) { EXPECT_EQ(2.0 * x, gradient); } -TEST(GradientProblem, EvalutaionWithManifoldAndNoGradient) { +TEST(GradientProblem, EvaluationWithManifoldAndNoGradient) { ceres::GradientProblem problem(new QuadraticTestFunction(), new EuclideanManifold<1>); double x = 7.0; diff --git a/internal/ceres/implicit_schur_complement.h b/internal/ceres/implicit_schur_complement.h index 601f2e638..75e05a42e 100644 --- a/internal/ceres/implicit_schur_complement.h +++ b/internal/ceres/implicit_schur_complement.h @@ -81,10 +81,10 @@ class BlockSparseMatrix; // (which for our purposes is an easily inverted block diagonal // matrix), it can be done in terms of matrix vector products with E, // F and (E'E)^-1. This class implements this functionality and other -// auxilliary bits needed to implement a CG solver on the Schur +// auxiliary bits needed to implement a CG solver on the Schur // complement using the PartitionedMatrixView object. // -// THREAD SAFETY: This class is nqot thread safe. In particular, the +// THREAD SAFETY: This class is not thread safe. In particular, the // RightMultiply (and the LeftMultiply) methods are not thread safe as // they depend on mutable arrays used for the temporaries needed to // compute the product y += Sx; diff --git a/internal/ceres/inner_product_computer.cc b/internal/ceres/inner_product_computer.cc index 1500817f5..6660b3862 100644 --- a/internal/ceres/inner_product_computer.cc +++ b/internal/ceres/inner_product_computer.cc @@ -263,7 +263,7 @@ void InnerProductComputer::ComputeOffsetsAndCreateResultMatrix( if (previous->row == current->row) { // if the current and previous terms are in the same row block, // then they differ in the column block, in which case advance - // col_nnz by the column size of the prevous term. + // col_nnz by the column size of the previous term. col_nnz += col_blocks[previous->col].size; } else { // If we have moved to a new row-block , then col_nnz is zero, diff --git a/internal/ceres/invert_psd_matrix_benchmark.cc b/internal/ceres/invert_psd_matrix_benchmark.cc index 017d331e0..eb8deb191 100644 --- a/internal/ceres/invert_psd_matrix_benchmark.cc +++ b/internal/ceres/invert_psd_matrix_benchmark.cc @@ -9,7 +9,7 @@ // this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation -// and/or other materils provided with the distribution. +// and/or other materials provided with the distribution. // * Neither the name of Google Inc. nor the names of its contributors may be // used to endorse or promote products derived from this software without // specific prior written permission. diff --git a/internal/ceres/iterative_schur_complement_solver.h b/internal/ceres/iterative_schur_complement_solver.h index c39a94e23..ea54d8eeb 100644 --- a/internal/ceres/iterative_schur_complement_solver.h +++ b/internal/ceres/iterative_schur_complement_solver.h @@ -52,7 +52,7 @@ class Preconditioner; // The algorithm used by this solver was developed in a series of // papers - "Agarwal et al, Bundle Adjustment in the Large, ECCV 2010" // and "Wu et al, Multicore Bundle Adjustment, submitted to CVPR -// 2011" at the Univeristy of Washington. +// 2011" at the University of Washington. // // The key idea is that one can run Conjugate Gradients on the Schur // Complement system without explicitly forming the Schur Complement diff --git a/internal/ceres/jet_test.cc b/internal/ceres/jet_test.cc index fe9dbf34a..1c85d01be 100644 --- a/internal/ceres/jet_test.cc +++ b/internal/ceres/jet_test.cc @@ -378,7 +378,7 @@ TEST(Jet, Log1p) { J x = MakeJet(1e-16, 1e-8, 1e-4); EXPECT_THAT(log1p(x), IsAlmostEqualTo(MakeJet(9.9999999999999998e-17, 1e-8, 1e-4))); - // log(1 + x) collapes to 0 + // log(1 + x) collapses to 0 J v = log(J{1} + x); EXPECT_TRUE(v.a == 0); } @@ -391,7 +391,7 @@ TEST(Jet, Expm1) { { // expm1(x) does not loose precision for small x J x = MakeJet(9.9999999999999998e-17, 1e-8, 1e-4); EXPECT_THAT(expm1(x), IsAlmostEqualTo(MakeJet(1e-16, 1e-8, 1e-4))); - // exp(x) - 1 collapes to 0 + // exp(x) - 1 collapses to 0 J v = exp(x) - J{1}; EXPECT_TRUE(v.a == 0); } diff --git a/internal/ceres/line_search.cc b/internal/ceres/line_search.cc index 7bd9c85b0..68d6bbe78 100644 --- a/internal/ceres/line_search.cc +++ b/internal/ceres/line_search.cc @@ -426,7 +426,7 @@ void WolfeLineSearch::DoSearch(const double step_size_estimate, // shrank the bracket width until it was below our minimum tolerance. // As these are 'artificial' constraints, and we would otherwise fail to // produce a valid point when ArmijoLineSearch would succeed, we return the - // point with the lowest cost found thus far which satsifies the Armijo + // point with the lowest cost found thus far which satisfies the Armijo // condition (but not the Wolfe conditions). summary->optimal_point = bracket_low; summary->success = true; @@ -448,8 +448,8 @@ void WolfeLineSearch::DoSearch(const double step_size_estimate, // defined by bracket_low & bracket_high, which satisfy: // // 1. The interval bounded by step sizes: bracket_low.x & bracket_high.x - // contains step sizes that satsify the strong Wolfe conditions. - // 2. bracket_low.x is of all the step sizes evaluated *which satisifed the + // contains step sizes that satisfy the strong Wolfe conditions. + // 2. bracket_low.x is of all the step sizes evaluated *which satisfied the // Armijo sufficient decrease condition*, the one which generated the // smallest function value, i.e. bracket_low.value < // f(all other steps satisfying Armijo). @@ -493,7 +493,7 @@ void WolfeLineSearch::DoSearch(const double step_size_estimate, // Or, searching was stopped due to an 'artificial' constraint, i.e. not // a condition imposed / required by the underlying algorithm, but instead an // engineering / implementation consideration. But a step which exceeds the -// minimum step size, and satsifies the Armijo condition was still found, +// minimum step size, and satisfies the Armijo condition was still found, // and should thus be used [zoom not required]. // // Returns false if no step size > minimum step size was found which @@ -517,7 +517,7 @@ bool WolfeLineSearch::BracketingPhase(const FunctionSample& initial_position, // As we require the gradient to evaluate the Wolfe condition, we always // calculate it together with the value, irrespective of the interpolation // type. As opposed to only calculating the gradient after the Armijo - // condition is satisifed, as the computational saving from this approach + // condition is satisfied, as the computational saving from this approach // would be slight (perhaps even negative due to the extra call). Also, // always calculating the value & gradient together protects against us // reporting invalid solutions if the cost function returns slightly different @@ -820,7 +820,7 @@ bool WolfeLineSearch::ZoomPhase(const FunctionSample& initial_position, // As we require the gradient to evaluate the Wolfe condition, we always // calculate it together with the value, irrespective of the interpolation // type. As opposed to only calculating the gradient after the Armijo - // condition is satisifed, as the computational saving from this approach + // condition is satisfied, as the computational saving from this approach // would be slight (perhaps even negative due to the extra call). Also, // always calculating the value & gradient together protects against us // reporting invalid solutions if the cost function returns slightly diff --git a/internal/ceres/line_search_direction.cc b/internal/ceres/line_search_direction.cc index ae77065f8..e93d3e907 100644 --- a/internal/ceres/line_search_direction.cc +++ b/internal/ceres/line_search_direction.cc @@ -241,7 +241,7 @@ class CERES_NO_EXPORT BFGS final : public LineSearchDirection { // // The original origin of this rescaling trick is somewhat unclear, the // earliest reference appears to be Oren [1], however it is widely - // discussed without specific attributation in various texts including + // discussed without specific attribution in various texts including // [2] (p143). // // [1] Oren S.S., Self-scaling variable metric (SSVM) algorithms diff --git a/internal/ceres/line_search_minimizer.cc b/internal/ceres/line_search_minimizer.cc index b3b2d1932..a75de18d1 100644 --- a/internal/ceres/line_search_minimizer.cc +++ b/internal/ceres/line_search_minimizer.cc @@ -30,7 +30,7 @@ // // Generic loop for line search based optimization algorithms. // -// This is primarily inpsired by the minFunc packaged written by Mark +// This is primarily inspired by the minFunc packaged written by Mark // Schmidt. // // http://www.di.ens.fr/~mschmidt/Software/minFunc.html diff --git a/internal/ceres/linear_solver.h b/internal/ceres/linear_solver.h index d8f3646ff..b07f53d61 100644 --- a/internal/ceres/linear_solver.h +++ b/internal/ceres/linear_solver.h @@ -328,7 +328,7 @@ class TypedLinearSolver : public LinearSolver { ExecutionSummary execution_summary_; }; -// Linear solvers that depend on acccess to the low level structure of +// Linear solvers that depend on access to the low level structure of // a SparseMatrix. // clang-format off typedef TypedLinearSolver BlockSparseMatrixSolver; // NOLINT diff --git a/internal/ceres/local_parameterization_test.cc b/internal/ceres/local_parameterization_test.cc index 38dbe2bae..cf5475822 100644 --- a/internal/ceres/local_parameterization_test.cc +++ b/internal/ceres/local_parameterization_test.cc @@ -603,19 +603,19 @@ struct LineParameterizationPlus { bool operator()(const Scalar* p_x, const Scalar* p_delta, Scalar* p_x_plus_delta) const { - static constexpr int kTangetSpaceDim = AmbientSpaceDim - 1; + static constexpr int kTangentSpaceDim = AmbientSpaceDim - 1; Eigen::Map> origin_point( p_x); Eigen::Map> dir( p_x + AmbientSpaceDim); - Eigen::Map> + Eigen::Map> delta_origin_point(p_delta); Eigen::Map> origin_point_plus_delta(p_x_plus_delta); HomogeneousVectorParameterizationPlus dir_plus; dir_plus(dir.data(), - p_delta + kTangetSpaceDim, + p_delta + kTangentSpaceDim, p_x_plus_delta + AmbientSpaceDim); Eigen::Matrix v; diff --git a/internal/ceres/low_rank_inverse_hessian.cc b/internal/ceres/low_rank_inverse_hessian.cc index 3e2368f17..42827e2ac 100644 --- a/internal/ceres/low_rank_inverse_hessian.cc +++ b/internal/ceres/low_rank_inverse_hessian.cc @@ -158,7 +158,7 @@ void LowRankInverseHessian::RightMultiply(const double* x_ptr, // // The original origin of this rescaling trick is somewhat unclear, the // earliest reference appears to be Oren [1], however it is widely discussed - // without specific attributation in various texts including [2] (p143/178). + // without specific attribution in various texts including [2] (p143/178). // // [1] Oren S.S., Self-scaling variable metric (SSVM) algorithms Part II: // Implementation and experiments, Management Science, diff --git a/internal/ceres/normal_prior.cc b/internal/ceres/normal_prior.cc index abefb5b3d..00d2f6030 100644 --- a/internal/ceres/normal_prior.cc +++ b/internal/ceres/normal_prior.cc @@ -55,7 +55,7 @@ bool NormalPrior::Evaluate(double const* const* parameters, VectorRef r(residuals, num_residuals()); // The following line should read // r = A_ * (p - b_); - // The extra eval is to get around a bug in the eigen library. + // The extra eval is to get around a bug in the Eigen library. r = A_ * (p - b_).eval(); if ((jacobians != nullptr) && (jacobians[0] != nullptr)) { MatrixRef(jacobians[0], num_residuals(), parameter_block_sizes()[0]) = A_; diff --git a/internal/ceres/parallel_for_cxx.cc b/internal/ceres/parallel_for_cxx.cc index f4fd4154e..df2f619ea 100644 --- a/internal/ceres/parallel_for_cxx.cc +++ b/internal/ceres/parallel_for_cxx.cc @@ -158,8 +158,8 @@ void ParallelFor(ContextImpl* context, // it on every iteration of the for loop. The thread ID is guaranteed to be in // [0, num_threads). // -// A performance analysis has shown this implementation is onpar with OpenMP and -// TBB. +// A performance analysis has shown this implementation is on par with OpenMP +// and TBB. void ParallelFor(ContextImpl* context, int start, int end, diff --git a/internal/ceres/parameter_block_ordering.h b/internal/ceres/parameter_block_ordering.h index 166fadc0f..f73ef2cf5 100644 --- a/internal/ceres/parameter_block_ordering.h +++ b/internal/ceres/parameter_block_ordering.h @@ -46,8 +46,8 @@ class Program; class ParameterBlock; // Uses an approximate independent set ordering to order the parameter -// blocks of a problem so that it is suitable for use with Schur -// complement based solvers. The output variable ordering contains an +// blocks of a problem so that it is suitable for use with Schur- +// complement-based solvers. The output variable ordering contains an // ordering of the parameter blocks and the return value is size of // the independent set or the number of e_blocks (see // schur_complement_solver.h for an explanation). Constant parameters diff --git a/internal/ceres/reorder_program.cc b/internal/ceres/reorder_program.cc index 4e75c3f57..a4f7c356e 100644 --- a/internal/ceres/reorder_program.cc +++ b/internal/ceres/reorder_program.cc @@ -288,7 +288,7 @@ bool LexicographicallyOrderResidualBlocks( // of the bucket. The filling order among the buckets is dictated by the // residual blocks. This loop uses the offsets as counters; subtracting one // from each offset as a residual block is placed in the bucket. When the - // filling is finished, the offset pointerts should have shifted down one + // filling is finished, the offset pointers should have shifted down one // entry (this is verified below). vector reordered_residual_blocks( (*residual_blocks).size(), static_cast(nullptr)); @@ -325,7 +325,7 @@ bool LexicographicallyOrderResidualBlocks( return true; } -// Pre-order the columns corresponding to the schur complement if +// Pre-order the columns corresponding to the Schur complement if // possible. static void MaybeReorderSchurComplementColumnsUsingSuiteSparse( const ParameterBlockOrdering& parameter_block_ordering, Program* program) { diff --git a/internal/ceres/reorder_program_test.cc b/internal/ceres/reorder_program_test.cc index 828aa25a1..0fbab4e10 100644 --- a/internal/ceres/reorder_program_test.cc +++ b/internal/ceres/reorder_program_test.cc @@ -165,7 +165,7 @@ TEST(_, ApplyOrderingNormal) { } #ifndef CERES_NO_SUITESPARSE -class ReorderProgramFoSparseCholeskyUsingSuiteSparseTest +class ReorderProgramForSparseCholeskyUsingSuiteSparseTest : public ::testing::Test { protected: void SetUp() override { @@ -204,7 +204,7 @@ class ReorderProgramFoSparseCholeskyUsingSuiteSparseTest double z_; }; -TEST_F(ReorderProgramFoSparseCholeskyUsingSuiteSparseTest, +TEST_F(ReorderProgramForSparseCholeskyUsingSuiteSparseTest, EverythingInGroupZero) { ParameterBlockOrdering linear_solver_ordering; linear_solver_ordering.AddElementToGroup(&x_, 0); @@ -214,7 +214,7 @@ TEST_F(ReorderProgramFoSparseCholeskyUsingSuiteSparseTest, ComputeAndValidateOrdering(linear_solver_ordering); } -TEST_F(ReorderProgramFoSparseCholeskyUsingSuiteSparseTest, ContiguousGroups) { +TEST_F(ReorderProgramForSparseCholeskyUsingSuiteSparseTest, ContiguousGroups) { ParameterBlockOrdering linear_solver_ordering; linear_solver_ordering.AddElementToGroup(&x_, 0); linear_solver_ordering.AddElementToGroup(&y_, 1); @@ -223,7 +223,7 @@ TEST_F(ReorderProgramFoSparseCholeskyUsingSuiteSparseTest, ContiguousGroups) { ComputeAndValidateOrdering(linear_solver_ordering); } -TEST_F(ReorderProgramFoSparseCholeskyUsingSuiteSparseTest, GroupsWithGaps) { +TEST_F(ReorderProgramForSparseCholeskyUsingSuiteSparseTest, GroupsWithGaps) { ParameterBlockOrdering linear_solver_ordering; linear_solver_ordering.AddElementToGroup(&x_, 0); linear_solver_ordering.AddElementToGroup(&y_, 2); @@ -232,7 +232,7 @@ TEST_F(ReorderProgramFoSparseCholeskyUsingSuiteSparseTest, GroupsWithGaps) { ComputeAndValidateOrdering(linear_solver_ordering); } -TEST_F(ReorderProgramFoSparseCholeskyUsingSuiteSparseTest, +TEST_F(ReorderProgramForSparseCholeskyUsingSuiteSparseTest, NonContiguousStartingAtTwo) { ParameterBlockOrdering linear_solver_ordering; linear_solver_ordering.AddElementToGroup(&x_, 2); diff --git a/internal/ceres/residual_block_test.cc b/internal/ceres/residual_block_test.cc index 2864ee10d..8f99b23de 100644 --- a/internal/ceres/residual_block_test.cc +++ b/internal/ceres/residual_block_test.cc @@ -74,7 +74,7 @@ class TernaryCostFunction : public CostFunction { } }; -TEST(ResidualBlock, EvaluteWithNoLossFunctionOrManifolds) { +TEST(ResidualBlock, EvaluateWithNoLossFunctionOrManifolds) { double scratch[64]; // Prepare the parameter blocks. @@ -199,7 +199,7 @@ class LocallyParameterizedCostFunction : public SizedCostFunction<3, 2, 3, 4> { } }; -TEST(ResidualBlock, EvaluteWithManifolds) { +TEST(ResidualBlock, EvaluateWithManifolds) { double scratch[64]; // Prepare the parameter blocks. diff --git a/internal/ceres/residual_block_utils_test.cc b/internal/ceres/residual_block_utils_test.cc index 2254619d9..54c23b8fa 100644 --- a/internal/ceres/residual_block_utils_test.cc +++ b/internal/ceres/residual_block_utils_test.cc @@ -66,7 +66,7 @@ static void CheckEvaluation(const CostFunction& cost_function, bool is_good) { is_good); } -// A CostFunction that behaves normaly, i.e., it computes numerically +// A CostFunction that behaves normally, i.e., it computes numerically // valid residuals and jacobians. class GoodCostFunction : public SizedCostFunction<1, 1> { public: diff --git a/internal/ceres/schur_complement_solver.h b/internal/ceres/schur_complement_solver.h index 0d069ebe3..cbccc75af 100644 --- a/internal/ceres/schur_complement_solver.h +++ b/internal/ceres/schur_complement_solver.h @@ -65,7 +65,7 @@ class SparseCholesky; // // E y + F z = b // -// Where x = [y;z] is a partition of the variables. The paritioning +// Where x = [y;z] is a partition of the variables. The partitioning // of the variables is such that, E'E is a block diagonal // matrix. Further, the rows of A are ordered so that for every // variable block in y, all the rows containing that variable block diff --git a/internal/ceres/schur_eliminator.h b/internal/ceres/schur_eliminator.h index 75be5ae3c..87cc5a8a6 100644 --- a/internal/ceres/schur_eliminator.h +++ b/internal/ceres/schur_eliminator.h @@ -168,9 +168,9 @@ class CERES_NO_EXPORT SchurEliminatorBase { public: virtual ~SchurEliminatorBase(); - // Initialize the eliminator. It is the user's responsibilty to call + // Initialize the eliminator. It is the user's responsibility to call // this function before calling Eliminate or BackSubstitute. It is - // also the caller's responsibilty to ensure that the + // also the caller's responsibility to ensure that the // CompressedRowBlockStructure object passed to this method is the // same one (or is equivalent to) the one associated with the // BlockSparseMatrix objects below. @@ -446,7 +446,7 @@ class CERES_NO_EXPORT SchurEliminatorForOneFBlock final const CompressedRowBlockStructure* bs = A.block_structure(); const double* values = A.values(); - // Add the diagonal to the schur complement. + // Add the diagonal to the Schur complement. if (D != nullptr) { typename EigenTypes::ConstVectorRef diag( D + bs->cols[num_eliminate_blocks_].position, kFBlockSize); @@ -478,7 +478,7 @@ class CERES_NO_EXPORT SchurEliminatorForOneFBlock final const Chunk& chunk = chunks_[i]; const int e_block_id = bs->rows[chunk.start].cells.front().block_id; - // Naming covention, e_t_e = e_block.transpose() * e_block; + // Naming convention, e_t_e = e_block.transpose() * e_block; Eigen::Matrix e_t_e; Eigen::Matrix e_t_f; Eigen::Matrix e_t_b; diff --git a/internal/ceres/schur_eliminator_impl.h b/internal/ceres/schur_eliminator_impl.h index 9ad0ebdd4..62b748701 100644 --- a/internal/ceres/schur_eliminator_impl.h +++ b/internal/ceres/schur_eliminator_impl.h @@ -106,7 +106,7 @@ void SchurEliminator::Init( } // TODO(sameeragarwal): Now that we may have subset block structure, - // we need to make sure that we account for the fact that somep + // we need to make sure that we account for the fact that some // point blocks only have a "diagonal" row and nothing more. // // This likely requires a slightly different algorithm, which works @@ -300,7 +300,7 @@ void SchurEliminator::Eliminate( thread_id, bs, inverse_ete, buffer, chunk.buffer_layout, lhs); }); - // For rows with no e_blocks, the schur complement update reduces to + // For rows with no e_blocks, the Schur complement update reduces to // S += F'F. NoEBlockRowsUpdate(A, b, uneliminated_row_begins_, lhs, rhs); } @@ -432,7 +432,7 @@ void SchurEliminator::UpdateRhs( // // ete = y11 * y11' + y12 * y12' // -// and the off diagonal blocks in the Guass Newton Hessian. +// and the off diagonal blocks in the Gauss Newton Hessian. // // buffer = [y11'(z11 + z12), y12' * z22, y11' * z51] // @@ -562,7 +562,7 @@ void SchurEliminator:: } } -// For rows with no e_blocks, the schur complement update reduces to S +// For rows with no e_blocks, the Schur complement update reduces to S // += F'F. This function iterates over the rows of A with no e_block, // and calls NoEBlockRowOuterProduct on each row. template @@ -595,7 +595,7 @@ void SchurEliminator:: } // A row r of A, which has no e_blocks gets added to the Schur -// Complement as S += r r'. This function is responsible for computing +// complement as S += r r'. This function is responsible for computing // the contribution of a single row r to the Schur complement. It is // very similar in structure to EBlockRowOuterProduct except for // one difference. It does not use any of the template diff --git a/internal/ceres/small_blas_test.cc b/internal/ceres/small_blas_test.cc index 78fc3c35f..6fa30a50c 100644 --- a/internal/ceres/small_blas_test.cc +++ b/internal/ceres/small_blas_test.cc @@ -103,7 +103,7 @@ MATRIX_FUN_TY(MatrixTransposeMatrixMultiplyNaive) #undef MATRIX_FUN_TY -// Initializes matrix entires. +// Initializes matrix entries. static void initMatrix(Matrix& mat) { for (int i = 0; i < mat.rows(); ++i) { for (int j = 0; j < mat.cols(); ++j) { diff --git a/internal/ceres/suitesparse.cc b/internal/ceres/suitesparse.cc index bac53272b..06b4379d0 100644 --- a/internal/ceres/suitesparse.cc +++ b/internal/ceres/suitesparse.cc @@ -228,7 +228,7 @@ bool SuiteSparse::BlockAMDOrdering(const cholmod_sparse* A, const int num_col_blocks = col_blocks.size(); // Arrays storing the compressed column structure of the matrix - // incoding the block sparsity of A. + // encoding the block sparsity of A. vector block_cols; vector block_rows; diff --git a/internal/ceres/suitesparse.h b/internal/ceres/suitesparse.h index f7bf3b1e2..816d2f1f2 100644 --- a/internal/ceres/suitesparse.h +++ b/internal/ceres/suitesparse.h @@ -90,7 +90,7 @@ class CERES_NO_EXPORT SuiteSparse { // Functions for building cholmod_sparse objects from sparse // matrices stored in triplet form. The matrix A is not - // modifed. Called owns the result. + // modified. Called owns the result. cholmod_sparse* CreateSparseMatrix(TripletSparseMatrix* A); // This function works like CreateSparseMatrix, except that the diff --git a/internal/ceres/trust_region_preprocessor_test.cc b/internal/ceres/trust_region_preprocessor_test.cc index 5938502fb..fd329a9aa 100644 --- a/internal/ceres/trust_region_preprocessor_test.cc +++ b/internal/ceres/trust_region_preprocessor_test.cc @@ -73,7 +73,7 @@ TEST(TrustRegionPreprocessor, ParameterBlockBoundsAreInvalid) { EXPECT_FALSE(preprocessor.Preprocess(options, &problem, &pp)); } -TEST(TrustRegionPreprocessor, ParamterBlockIsInfeasible) { +TEST(TrustRegionPreprocessor, ParameterBlockIsInfeasible) { ProblemImpl problem; double x = 3.0; problem.AddParameterBlock(&x, 1);