You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@systemml.apache.org by ac...@apache.org on 2016/03/10 20:04:05 UTC

incubator-systemml git commit: [SYSTEMML-571] Uaggouterchain fix

Repository: incubator-systemml
Updated Branches:
  refs/heads/master c9516e768 -> 52776144a


[SYSTEMML-571] Uaggouterchain fix


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

Branch: refs/heads/master
Commit: 52776144a86979b9bbd82d7aa863e0480c08c571
Parents: c9516e7
Author: Arvind Surve <ac...@yahoo.com>
Authored: Thu Mar 10 11:02:53 2016 -0800
Committer: Arvind Surve <ac...@yahoo.com>
Committed: Thu Mar 10 11:02:53 2016 -0800

----------------------------------------------------------------------
 .../runtime/matrix/data/LibMatrixOuterAgg.java  | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/52776144/src/main/java/org/apache/sysml/runtime/matrix/data/LibMatrixOuterAgg.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/matrix/data/LibMatrixOuterAgg.java b/src/main/java/org/apache/sysml/runtime/matrix/data/LibMatrixOuterAgg.java
index 38df263..fd551d5 100644
--- a/src/main/java/org/apache/sysml/runtime/matrix/data/LibMatrixOuterAgg.java
+++ b/src/main/java/org/apache/sysml/runtime/matrix/data/LibMatrixOuterAgg.java
@@ -1203,8 +1203,9 @@ public class LibMatrixOuterAgg
 			return ixMax;
 		
 		int ix = Arrays.binarySearch(bv, value);
-		ix = Math.abs(ix)-1;
-		ixMax = bvi[ix-1]+1; 
+		if(ix < 0)
+			ix = Math.abs(ix)-2;
+		ixMax = bvi[ix]+1; 
 		
 		return ixMax;
 	}
@@ -1228,8 +1229,8 @@ public class LibMatrixOuterAgg
 		
 		int ix = Arrays.binarySearch(bv, value);
 		if (ix < 0) 
-			ix = Math.abs(ix)-1;
-		ixMax = bvi[ix-1]+1; 
+			ix = Math.abs(ix)-2;
+		ixMax = bvi[ix]+1; 
 		
 		return ixMax;
 	}
@@ -1247,12 +1248,13 @@ public class LibMatrixOuterAgg
 	{
 		int ixMax = bv.length;
 		
-		if(value < bv[0] || value > bv[bv.length-1]) 
+		if(value <= bv[0] || value > bv[bv.length-1]) 
 			return ixMax;
 		
 		int ix = Arrays.binarySearch(bv, value);
-		ix = Math.abs(ix);
-		ixMax = bvi[ix-1]+1; 
+		if(ix < 0)
+			ix = Math.abs(ix)-1;
+		ixMax = bvi[ix]+1; 
 		
 		return ixMax;
 	}
@@ -1363,8 +1365,8 @@ public class LibMatrixOuterAgg
 		
 		int ix = Arrays.binarySearch(bv, value);
 		if (ix < 0) 
-			ix = Math.abs(ix)-1;
-		ixMin = bvi[ix-1]+1; 
+			ix = Math.abs(ix)-2;
+		ixMin = bvi[ix]+1; 
 		
 		return ixMin;
 	}