You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@systemml.apache.org by mb...@apache.org on 2016/01/24 01:09:19 UTC

[2/5] incubator-systemml git commit: [SYSTEMML-382] Fix sparse-safe scalar operations over sparse blocks

[SYSTEMML-382] Fix sparse-safe scalar operations over sparse blocks

Project: http://git-wip-us.apache.org/repos/asf/incubator-systemml/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-systemml/commit/9cb7d553
Tree: http://git-wip-us.apache.org/repos/asf/incubator-systemml/tree/9cb7d553
Diff: http://git-wip-us.apache.org/repos/asf/incubator-systemml/diff/9cb7d553

Branch: refs/heads/master
Commit: 9cb7d553fc0d91798a063e0ccceb2d4a51f8f52b
Parents: 205cfd3
Author: Matthias Boehm <mb...@us.ibm.com>
Authored: Fri Jan 22 16:44:55 2016 -0800
Committer: Matthias Boehm <mb...@us.ibm.com>
Committed: Sat Jan 23 16:08:00 2016 -0800

----------------------------------------------------------------------
 .../apache/sysml/runtime/matrix/data/LibMatrixBincell.java   | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/9cb7d553/src/main/java/org/apache/sysml/runtime/matrix/data/LibMatrixBincell.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/matrix/data/LibMatrixBincell.java b/src/main/java/org/apache/sysml/runtime/matrix/data/LibMatrixBincell.java
index 5428c96..47a46d4 100644
--- a/src/main/java/org/apache/sysml/runtime/matrix/data/LibMatrixBincell.java
+++ b/src/main/java/org/apache/sysml/runtime/matrix/data/LibMatrixBincell.java
@@ -924,7 +924,7 @@ public class LibMatrixBincell
 			SparseBlock a = m1.sparseBlock;
 			SparseBlock c = ret.sparseBlock;
 			
-			for(int r=0; r<Math.min(m1.rlen, m1.sparseBlock.numRows()); r++) {
+			for(int r=0; r<Math.min(m1.rlen, a.numRows()); r++) {
 				if( !a.isEmpty(r) )
 				{
 					int apos = a.pos(r);
@@ -955,12 +955,10 @@ public class LibMatrixBincell
 						if( op.fn instanceof Multiply || op.fn instanceof Multiply2 
 							|| op.fn instanceof Power2  )
 						{
-							c.allocate(r, alen, -1);
-							//TODO perf sparse block
-							//c[r] = new SparseRow(alen);
+							c.allocate(r, alen, ret.clen);
 						}
 						
-						for(int j=0; j<alen; j++) {
+						for(int j=apos; j<apos+alen; j++) {
 							double val = op.executeScalar(avals[j]);
 							ret.appendValue(r, aix[j], val);
 						}