Repository: systemml Updated Branches: refs/heads/master 8c11b5d82 -> fdc24bb7d
[SYSTEMML-2036] Fix removeEmpty nnz maintenance with selection vector This patch fixes the maintenance of nnz meta data in removeEmpty. So far, this operation propagated the nnz from the input, which is only correct without selection vector or if the selection vector indicates all rows with non-zeros. Project: http://git-wip-us.apache.org/repos/asf/systemml/repo Commit: http://git-wip-us.apache.org/repos/asf/systemml/commit/c1860ce5 Tree: http://git-wip-us.apache.org/repos/asf/systemml/tree/c1860ce5 Diff: http://git-wip-us.apache.org/repos/asf/systemml/diff/c1860ce5 Branch: refs/heads/master Commit: c1860ce5630cc00cfe2312d1cb7f8fd90a513280 Parents: 8c11b5d Author: Matthias Boehm <[email protected]> Authored: Wed Dec 6 18:26:38 2017 -0800 Committer: Matthias Boehm <[email protected]> Committed: Thu Dec 7 13:36:01 2017 -0800 ---------------------------------------------------------------------- .../org/apache/sysml/runtime/matrix/data/LibMatrixReorg.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/systemml/blob/c1860ce5/src/main/java/org/apache/sysml/runtime/matrix/data/LibMatrixReorg.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/runtime/matrix/data/LibMatrixReorg.java b/src/main/java/org/apache/sysml/runtime/matrix/data/LibMatrixReorg.java index 80b3285..8cf20ed 100644 --- a/src/main/java/org/apache/sysml/runtime/matrix/data/LibMatrixReorg.java +++ b/src/main/java/org/apache/sysml/runtime/matrix/data/LibMatrixReorg.java @@ -1781,7 +1781,8 @@ public class LibMatrixReorg } //check sparsity - ret.nonZeros = in.nonZeros; + ret.nonZeros = (select==null) ? + in.nonZeros : ret.recomputeNonZeros(); ret.examSparsity(); return ret; @@ -1901,7 +1902,8 @@ public class LibMatrixReorg } //check sparsity - ret.nonZeros = in.nonZeros; + ret.nonZeros = (select==null) ? + in.nonZeros : ret.recomputeNonZeros(); ret.examSparsity(); return ret;
