Skip to content

Commit

Permalink
[MINOR] Fix empty sparse row bug in CLA
Browse files Browse the repository at this point in the history
There was an edge case not fixed for CLA where the pre-aggregate
to add to a matrix returned empty rows. This commit fixes those instances.
  • Loading branch information
Baunsgaard committed Oct 17, 2023
1 parent 0e2e784 commit 65e31c7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,8 @@ private void addMatrixToResult(MatrixBlock tmp, MatrixBlock result, IColIndex ro
if(tmp.isInSparseFormat()) {
SparseBlock sb = tmp.getSparseBlock();
for(int row = 0; row < rowIndexes.size(); row++) {
if(sb.isEmpty(row))
continue;
final int apos = sb.pos(row);
final int alen = sb.size(row);
final int[] aix = sb.indexes(row);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,8 @@ public static void addMatrixToResult(MatrixBlock tmp, MatrixBlock result, IColIn
if(tmp.isInSparseFormat()) {
final SparseBlock sb = tmp.getSparseBlock();
for(int row = rl, offT = 0; row < ru; row++, offT++) {
if(sb.isEmpty(offT))
continue;
final int apos = sb.pos(offT);
final int alen = sb.size(offT);
final int[] aix = sb.indexes(offT);
Expand Down

0 comments on commit 65e31c7

Please sign in to comment.