File tree Expand file tree Collapse file tree 1 file changed +20
-8
lines changed
src/main/java/org/apache/sysds/runtime/compress/colgroup/mapping Expand file tree Collapse file tree 1 file changed +20
-8
lines changed Original file line number Diff line number Diff line change 3030import org .apache .commons .lang3 .NotImplementedException ;
3131import org .apache .commons .logging .Log ;
3232import org .apache .commons .logging .LogFactory ;
33+ import org .apache .sysds .runtime .DMLRuntimeException ;
3334import org .apache .sysds .runtime .compress .CompressedMatrixBlock ;
3435import org .apache .sysds .runtime .compress .DMLCompressionException ;
3536import org .apache .sysds .runtime .compress .colgroup .IMapToDataGroup ;
@@ -1044,14 +1045,25 @@ public String toString() {
10441045 }
10451046
10461047 public AMapToData removeEmpty (final boolean [] selectV , final int rOut ) {
1047- final AMapToData ret = MapToFactory .create (rOut , getUnique ());
1048- final int s = size ();
1049- int t = 0 ;
1050- for (int i = 0 ; i < s ; i ++)
1051- if (selectV [i ] == true )
1052- ret .set (t ++, getIndex (i ));
1053-
1054- return ret ;
1048+ try {
1049+
1050+ final AMapToData ret = MapToFactory .create (rOut , getUnique ());
1051+ final int s = size ();
1052+ int t = 0 ;
1053+ for (int i = 0 ; i < s ; i ++)
1054+ if (selectV [i ] == true )
1055+ ret .set (t ++, getIndex (i ));
1056+
1057+ return ret ;
1058+ }
1059+ catch (ArrayIndexOutOfBoundsException e ){
1060+
1061+ int trueCount = 0 ;
1062+ for (boolean a : selectV ){
1063+ if (a ) trueCount ++;
1064+ }
1065+ throw new DMLRuntimeException ("actual number of true values " + trueCount + " vs argument " + rOut ,e );
1066+ }
10551067 }
10561068
10571069 /**
You can’t perform that action at this time.
0 commit comments