From 2a2b9bd6fa2a0ee62f58dceb786cb2dc3eb37630 Mon Sep 17 00:00:00 2001 From: Sameer Agarwal Date: Sun, 15 Aug 2021 16:52:08 -0700 Subject: [PATCH] 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 --- internal/ceres/covariance_impl.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/ceres/covariance_impl.cc b/internal/ceres/covariance_impl.cc index 65fe7c607..dbfabede2 100644 --- a/internal/ceres/covariance_impl.cc +++ b/internal/ceres/covariance_impl.cc @@ -217,7 +217,7 @@ bool CovarianceImpl::GetCovarianceBlockInTangentOrAmbientSpace( 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.