Repository: systemml Updated Branches: refs/heads/master d74ded67c -> 3d61fddd9
[SYSTEMML-2296] Exploit matrix histogram symmetry for improved accuracy Matrix histograms exploit common structural properties of sparse and ultra-sparse matrices that allow for exact inference of the output sparsity for special cases. This patch improves the matrix histogram implementation to exploit not just structural information of the left-hand-side but symmetrically also of the right-hand-side. Project: http://git-wip-us.apache.org/repos/asf/systemml/repo Commit: http://git-wip-us.apache.org/repos/asf/systemml/commit/53fa0460 Tree: http://git-wip-us.apache.org/repos/asf/systemml/tree/53fa0460 Diff: http://git-wip-us.apache.org/repos/asf/systemml/diff/53fa0460 Branch: refs/heads/master Commit: 53fa046010aafa93c754324f4c2e3dd9d157300c Parents: d74ded6 Author: Matthias Boehm <[email protected]> Authored: Sat May 5 20:43:20 2018 -0700 Committer: Matthias Boehm <[email protected]> Committed: Sat May 5 20:43:20 2018 -0700 ---------------------------------------------------------------------- .../org/apache/sysml/hops/estim/EstimatorMatrixHistogram.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/systemml/blob/53fa0460/src/main/java/org/apache/sysml/hops/estim/EstimatorMatrixHistogram.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/sysml/hops/estim/EstimatorMatrixHistogram.java b/src/main/java/org/apache/sysml/hops/estim/EstimatorMatrixHistogram.java index 18c4a22..1467130 100644 --- a/src/main/java/org/apache/sysml/hops/estim/EstimatorMatrixHistogram.java +++ b/src/main/java/org/apache/sysml/hops/estim/EstimatorMatrixHistogram.java @@ -73,7 +73,7 @@ public class EstimatorMatrixHistogram extends SparsityEstimator long nnz = 0; //special case, with exact sparsity estimate, where the dot product //dot(h1.cNnz,h2rNnz) gives the exact number of non-zeros in the output - if( h1.rMaxNnz <= 1 ) { + if( h1.rMaxNnz <= 1 || h2.cMaxNnz <= 1 ) { for( int j=0; j<h1.getCols(); j++ ) nnz += h1.cNnz[j] * h2.rNnz[j]; } @@ -97,7 +97,6 @@ public class EstimatorMatrixHistogram extends SparsityEstimator private final int[] rNnz; private final int[] cNnz; private int rMaxNnz = 0; - @SuppressWarnings("unused") private int cMaxNnz = 0; public MatrixHistogram(MatrixBlock in) {
