You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@systemml.apache.org by de...@apache.org on 2016/09/15 22:14:57 UTC

incubator-systemml git commit: Improve rangeReIndex error message if scalar is indexed

Repository: incubator-systemml
Updated Branches:
  refs/heads/master 0f243b8f4 -> b20727de5


Improve rangeReIndex error message if scalar is indexed

Closes #234.


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

Branch: refs/heads/master
Commit: b20727de57290f58e2d1265bb8d3c1511e68374b
Parents: 0f243b8
Author: Nakul Jindal <na...@gmail.com>
Authored: Thu Sep 15 15:11:08 2016 -0700
Committer: Deron Eriksson <de...@us.ibm.com>
Committed: Thu Sep 15 15:11:08 2016 -0700

----------------------------------------------------------------------
 .../sysml/runtime/instructions/cp/IndexingCPInstruction.java | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/b20727de/src/main/java/org/apache/sysml/runtime/instructions/cp/IndexingCPInstruction.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/instructions/cp/IndexingCPInstruction.java b/src/main/java/org/apache/sysml/runtime/instructions/cp/IndexingCPInstruction.java
index 402f0d5..37b1e91 100644
--- a/src/main/java/org/apache/sysml/runtime/instructions/cp/IndexingCPInstruction.java
+++ b/src/main/java/org/apache/sysml/runtime/instructions/cp/IndexingCPInstruction.java
@@ -91,8 +91,10 @@ public abstract class IndexingCPInstruction extends UnaryCPInstruction
 				out.split(parts[6]);
 				if( in.getDataType()==DataType.MATRIX )
 					return new MatrixIndexingCPInstruction(new SimpleOperator(null), in, rl, ru, cl, cu, out, opcode, str);
-				else //DataType.FRAME
+				else if (in.getDataType() == DataType.FRAME)
 					return new FrameIndexingCPInstruction(new SimpleOperator(null), in, rl, ru, cl, cu, out, opcode, str);
+				else 
+					throw new DMLRuntimeException("Can index only on Frames or Matrices");
 			}
 			else {
 				throw new DMLRuntimeException("Invalid number of operands in instruction: " + str);
@@ -118,8 +120,10 @@ public abstract class IndexingCPInstruction extends UnaryCPInstruction
 				out.split(parts[7]);
 				if( lhsInput.getDataType()==DataType.MATRIX )
 					return new MatrixIndexingCPInstruction(new SimpleOperator(null), lhsInput, rhsInput, rl, ru, cl, cu, out, opcode, str);
-				else //DataType.FRAME
+				else if (lhsInput.getDataType() == DataType.FRAME)
 					return new FrameIndexingCPInstruction(new SimpleOperator(null), lhsInput, rhsInput, rl, ru, cl, cu, out, opcode, str);
+				else 
+					throw new DMLRuntimeException("Can index only on Frames or Matrices");
 			}
 			else {
 				throw new DMLRuntimeException("Invalid number of operands in instruction: " + str);