Address comments from William Rucklidge

Change-Id: I0c4f686b89798435741c55a5ca45cf000af842dc
diff --git a/include/ceres/dynamic_cost_function_to_functor.h b/include/ceres/dynamic_cost_function_to_functor.h
index 2c65059..10bc99a 100644
--- a/include/ceres/dynamic_cost_function_to_functor.h
+++ b/include/ceres/dynamic_cost_function_to_functor.h
@@ -116,7 +116,8 @@
   bool operator()(JetT const* const* inputs, JetT* output) const {
     const std::vector<int32>& parameter_block_sizes =
         cost_function_->parameter_block_sizes();
-    const int num_parameter_blocks = static_cast<int>(parameter_block_sizes.size());
+    const int num_parameter_blocks =
+        static_cast<int>(parameter_block_sizes.size());
     const int num_residuals = cost_function_->num_residuals();
     const int num_parameters = std::accumulate(parameter_block_sizes.begin(),
                                                parameter_block_sizes.end(), 0);
diff --git a/internal/ceres/sparse_normal_cholesky_solver.cc b/internal/ceres/sparse_normal_cholesky_solver.cc
index 9c725ff..557ebd8 100644
--- a/internal/ceres/sparse_normal_cholesky_solver.cc
+++ b/internal/ceres/sparse_normal_cholesky_solver.cc
@@ -359,11 +359,11 @@
   summary.num_iterations = 1;
   summary.message = "Success.";
 
-  // Map outer_product_ to an lower triangular column major matrix.
+  // Map outer_product_ to a lower triangular column major matrix.
   //
   // outer_product_ is a compressed row sparse matrix and in upper
   // triangular form, when mapped to a compressed column sparse
-  // matrix, it becomes an lower triangular matrix.
+  // matrix, it becomes a lower triangular matrix.
   const int num_cols = outer_product_->num_cols();
   cholmod_sparse lhs =
       ss_.CreateSparseMatrixTransposeView(outer_product_.get());
diff --git a/internal/ceres/triplet_sparse_matrix.cc b/internal/ceres/triplet_sparse_matrix.cc
index a7df060..cd19444 100644
--- a/internal/ceres/triplet_sparse_matrix.cc
+++ b/internal/ceres/triplet_sparse_matrix.cc
@@ -85,6 +85,8 @@
   // All the sizes should at least be zero
   CHECK_GE(num_rows, 0);
   CHECK_GE(num_cols, 0);
+  CHECK_EQ(rows.size(), cols.size());
+  CHECK_EQ(rows.size(), values.size());
   AllocateMemory();
   std::copy(rows.begin(), rows.end(), rows_.get());
   std::copy(cols.begin(), cols.end(), cols_.get());
@@ -305,9 +307,6 @@
         }
       }
     }
-    if (!rows.empty()) {
-      break;
-    }
   }
 
   return new TripletSparseMatrix(
diff --git a/internal/ceres/visibility_based_preconditioner.cc b/internal/ceres/visibility_based_preconditioner.cc
index 429626a..7e1ac67 100644
--- a/internal/ceres/visibility_based_preconditioner.cc
+++ b/internal/ceres/visibility_based_preconditioner.cc
@@ -342,7 +342,8 @@
   eliminator_options.row_block_size = options_.row_block_size;
   eliminator_.reset(SchurEliminatorBase::Create(eliminator_options));
   const bool kFullRankETE = true;
-  eliminator_->Init(eliminator_options.elimination_groups[0], kFullRankETE, &bs);
+  eliminator_->Init(
+      eliminator_options.elimination_groups[0], kFullRankETE, &bs);
 }
 
 // Update the values of the preconditioner matrix and factorize it.