Fix an off by one error in the transpose code.

Change-Id: I0ebcf2e8e29dc48376f60c3fa8d6100b20ec105f
This commit is contained in:
Sameer Agarwal
2017-04-13 09:47:38 -07:00
parent 9a6b4a6491
commit a171ba095c
@@ -78,7 +78,7 @@ void TransposeForCompressedRowSparseStructure(const int num_rows,
int* transpose_cols,
double* transpose_values) {
// Explicitly zero out transpose_rows.
std::fill(transpose_rows, transpose_rows + num_cols, 0);
std::fill(transpose_rows, transpose_rows + num_cols + 1, 0);
// Count the number of entries in each column of the original matrix
// and assign to transpose_rows[col + 1].