Remove a CHECK failure from covariance_impl.cc
The CHECK was to see if SuiteSparseQR returns a non-null QR
factorization. However this can cause problems in production, so its
better to return false and let the user deal with the failure in
factorization.
Change-Id: I4e67f343e30547f4257d0315d507df9864c06dcc
diff --git a/internal/ceres/covariance_impl.cc b/internal/ceres/covariance_impl.cc
index d24f5c9..299dda8 100644
--- a/internal/ceres/covariance_impl.cc
+++ b/internal/ceres/covariance_impl.cc
@@ -651,7 +651,12 @@
&permutation,
&cc);
event_logger.AddEvent("Numeric Factorization");
- CHECK(R != nullptr);
+ if (R == nullptr) {
+ LOG(ERROR) << "Something is wrong. SuiteSparseQR returned R = nullptr.";
+ free(permutation);
+ cholmod_l_finish(&cc);
+ return false;
+ }
if (rank < cholmod_jacobian.ncol) {
LOG(ERROR) << "Jacobian matrix is rank deficient. "