clang-tidy fixes. 1. Mismatched variable names in local_parameterization.h/cc 2. Add missing final directives in iterative_refiner_test.cc Change-Id: I954ef00d74c3b5d99f3659cc5c6ee2293fa9ff92
diff --git a/internal/ceres/iterative_refiner_test.cc b/internal/ceres/iterative_refiner_test.cc index a557cb5..c474ede 100644 --- a/internal/ceres/iterative_refiner_test.cc +++ b/internal/ceres/iterative_refiner_test.cc
@@ -103,10 +103,10 @@ } // The following methods are not needed for tests in this file. - CompressedRowSparseMatrix::StorageType StorageType() const + CompressedRowSparseMatrix::StorageType StorageType() const final DO_NOT_CALL_WITH_RETURN(CompressedRowSparseMatrix::UPPER_TRIANGULAR); LinearSolverTerminationType Factorize(CompressedRowSparseMatrix* lhs, - std::string* message) + std::string* message) final DO_NOT_CALL_WITH_RETURN(LINEAR_SOLVER_FAILURE); LinearSolverTerminationType FactorAndSolve(
diff --git a/internal/ceres/local_parameterization.cc b/internal/ceres/local_parameterization.cc index 4d63594..c99bce7 100644 --- a/internal/ceres/local_parameterization.cc +++ b/internal/ceres/local_parameterization.cc
@@ -141,19 +141,19 @@ } bool SubsetParameterization::MultiplyByJacobian(const double* x, - const int num_rows, - const double* global_matrix, - double* local_matrix) const { + const int num_cols, + const double* global_matrix, + double* local_matrix) const { if (local_size_ == 0) { return true; } const int global_size = GlobalSize(); - for (int row = 0; row < num_rows; ++row) { - for (int col = 0, j = 0; col < global_size; ++col) { - if (!constancy_mask_[col]) { - local_matrix[row * local_size_ + j++] = - global_matrix[row * global_size + col]; + for (int col = 0; col < num_cols; ++col) { + for (int i = 0, j = 0; i < global_size; ++i) { + if (!constancy_mask_[i]) { + local_matrix[col * local_size_ + j++] = + global_matrix[col * global_size + i]; } } }