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/22 01:27:41 UTC

incubator-systemml git commit: [HOTFIX][SYSTEMML-381] Fix robustness sparse block copy (empty blocks)

Repository: incubator-systemml
Updated Branches:
  refs/heads/master e3f79680b -> e868fc60e


[HOTFIX][SYSTEMML-381] Fix robustness sparse block copy (empty 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/e868fc60
Tree: http://git-wip-us.apache.org/repos/asf/incubator-systemml/tree/e868fc60
Diff: http://git-wip-us.apache.org/repos/asf/incubator-systemml/diff/e868fc60

Branch: refs/heads/master
Commit: e868fc60ef59a6addb5a485ec7cc8dd212020d46
Parents: e3f7968
Author: Matthias Boehm <mb...@us.ibm.com>
Authored: Thu Jan 21 16:26:49 2016 -0800
Committer: Matthias Boehm <mb...@us.ibm.com>
Committed: Thu Jan 21 16:26:49 2016 -0800

----------------------------------------------------------------------
 .../org/apache/sysml/runtime/matrix/data/SparseBlockFactory.java | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/e868fc60/src/main/java/org/apache/sysml/runtime/matrix/data/SparseBlockFactory.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/matrix/data/SparseBlockFactory.java b/src/main/java/org/apache/sysml/runtime/matrix/data/SparseBlockFactory.java
index 2de508e..1ac8f16 100644
--- a/src/main/java/org/apache/sysml/runtime/matrix/data/SparseBlockFactory.java
+++ b/src/main/java/org/apache/sysml/runtime/matrix/data/SparseBlockFactory.java
@@ -65,6 +65,10 @@ public abstract class SparseBlockFactory
 	 */
 	public static SparseBlock copySparseBlock( SparseBlock.Type type, SparseBlock sblock, boolean forceCopy )
 	{
+		//sanity check for empty inputs
+		if( sblock == null )
+			return null;
+		
 		//check for existing target type
 		if( !forceCopy && 
 			( (sblock instanceof SparseBlockMCSR && type == SparseBlock.Type.MCSR)