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 <[email protected]>
Authored: Thu Jan 21 16:26:49 2016 -0800
Committer: Matthias Boehm <[email protected]>
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)

Reply via email to