Fix a bug in covariance_impl.cc A matrix reference was being incorrectly sized. It was using the block_size number of rows, where as there are only block_local_size number of rows that are present in the underlying matrix. This did not affect the correctness of the resulting code, because right after construction we then access a subblock with block_local_size rows. Thanks to William Gandler for reporting this. Change-Id: I35e1f5a30b79e31b0b9fac79f7e361821d6073df
diff --git a/internal/ceres/covariance_impl.cc b/internal/ceres/covariance_impl.cc index 65fe7c6..dbfabed 100644 --- a/internal/ceres/covariance_impl.cc +++ b/internal/ceres/covariance_impl.cc
@@ -217,7 +217,7 @@ const int block2_local_size = block2->LocalSize(); ConstMatrixRef cov( - covariance_matrix_->values() + rows[row_begin], block1_size, row_size); + covariance_matrix_->values() + rows[row_begin], block1_local_size, row_size); // Fast path when there are no local parameterizations or if the // user does not want it lifted to the ambient space.