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
This commit is contained in:
Sameer Agarwal
2021-08-15 16:52:08 -07:00
parent 27fade7b8c
commit 2a2b9bd6fa
+1 -1
View File
@@ -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.