Repository: incubator-systemml
Updated Branches:
  refs/heads/master 30b6cb03f -> d3cfcafcf


[SYSTEMML-1167] Fix size propagation right indexing (all rows/columns)

This patch fixes specific issues of inferring the size of X[1:n,1:m],
where n=nrow(Y) and m=ncol(Z). Until now, we always used n=nrow(X) and
m=ncol(X) even if Y!=X or Z!=X.

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

Branch: refs/heads/master
Commit: d3cfcafcf38ab2b11f47621c475da44614e4f582
Parents: 30b6cb0
Author: Matthias Boehm <[email protected]>
Authored: Thu Feb 9 04:56:07 2017 +0100
Committer: Matthias Boehm <[email protected]>
Committed: Thu Feb 9 06:50:16 2017 +0100

----------------------------------------------------------------------
 .../java/org/apache/sysml/hops/IndexingOp.java     | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/d3cfcafc/src/main/java/org/apache/sysml/hops/IndexingOp.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/hops/IndexingOp.java 
b/src/main/java/org/apache/sysml/hops/IndexingOp.java
index 0d870b9..9437cef 100644
--- a/src/main/java/org/apache/sysml/hops/IndexingOp.java
+++ b/src/main/java/org/apache/sysml/hops/IndexingOp.java
@@ -402,7 +402,6 @@ public class IndexingOp extends Hop
        @Override
        public void refreshSizeInformation()
        {
-               Hop input1 = getInput().get(0); //original matrix
                Hop input2 = getInput().get(1); //inpRowL
                Hop input3 = getInput().get(2); //inpRowU
                Hop input4 = getInput().get(3); //inpColL
@@ -421,9 +420,11 @@ public class IndexingOp extends Hop
                //set dimension information
                if( _rowLowerEqualsUpper ) //ROWS
                        setDim1(1);
-               else if( allRows ) 
-                       setDim1(input1.getDim1());
-               else if( constRowRange ){
+               else if( allRows ) {
+                       //input3 guaranteed to be a unaryop-nrow
+                       setDim1(input3.getInput().get(0).getDim1());
+               }
+               else if( constRowRange ) {
                        setDim1( 
HopRewriteUtils.getIntValueSafe((LiteralOp)input3)
                                        
-HopRewriteUtils.getIntValueSafe((LiteralOp)input2)+1 );
                }
@@ -433,9 +434,11 @@ public class IndexingOp extends Hop
                
                if( _colLowerEqualsUpper ) //COLS
                        setDim2(1);
-               else if( allCols ) 
-                       setDim2(input1.getDim2());
-               else if( constColRange ){
+               else if( allCols ) {
+                       //input5 guaranteed to be a unaryop-ncol
+                       setDim2(input5.getInput().get(0).getDim2());
+               }
+               else if( constColRange ) {
                        setDim2( 
HopRewriteUtils.getIntValueSafe((LiteralOp)input5)
                                        
-HopRewriteUtils.getIntValueSafe((LiteralOp)input4)+1 );
                }

Reply via email to