@@ -237,7 +237,7 @@ private static MatrixBlock decompressExecute(CompressedMatrixBlock cmb, int k) {
237237 if (ret .isInSparseFormat ())
238238 decompressSparseSingleThread (ret , filteredGroups , nRows , blklen );
239239 else
240- decompressDenseSingleThread (ret , filteredGroups , nRows , blklen , constV , eps , nonZeros , overlapping );
240+ decompressDenseSingleThread (ret , filteredGroups , nRows , blklen , constV , eps , overlapping );
241241 }
242242 else if (ret .isInSparseFormat ())
243243 decompressSparseMultiThread (ret , filteredGroups , nRows , blklen , k );
@@ -294,7 +294,7 @@ private static void decompressSparseSingleThread(MatrixBlock ret, List<AColGroup
294294 }
295295
296296 private static void decompressDenseSingleThread (MatrixBlock ret , List <AColGroup > filteredGroups , int rlen ,
297- int blklen , double [] constV , double eps , long nonZeros , boolean overlapping ) {
297+ int blklen , double [] constV , double eps , boolean overlapping ) {
298298
299299 final DenseBlock db = ret .getDenseBlock ();
300300 final int nCol = ret .getNumColumns ();
@@ -308,21 +308,19 @@ private static void decompressDenseSingleThread(MatrixBlock ret, List<AColGroup>
308308 }
309309 }
310310
311- // private static void decompressDenseMultiThread(MatrixBlock ret, List<AColGroup> groups, double[] constV, int k,
312- // boolean overlapping) {
313- // final int nRows = ret.getNumRows();
314- // final double eps = getEps(constV);
315- // final int blklen = Math.max(nRows / k, 512);
316- // decompressDenseMultiThread(ret, groups, nRows, blklen, constV, eps, k, overlapping);
317- // }
318-
319- protected static void decompressDenseMultiThread (MatrixBlock ret , List <AColGroup > groups , double [] constV ,
311+ public static void decompressDense (MatrixBlock ret , List <AColGroup > groups , double [] constV ,
320312 double eps , int k , boolean overlapping ) {
321313
322314 Timing time = new Timing (true );
323315 final int nRows = ret .getNumRows ();
324316 final int blklen = Math .max (nRows / k , 512 );
325- decompressDenseMultiThread (ret , groups , nRows , blklen , constV , eps , k , overlapping );
317+ if ( k > 1 )
318+ decompressDenseMultiThread (ret , groups , nRows , blklen , constV , eps , k , overlapping );
319+ else
320+ decompressDenseSingleThread (ret , groups , nRows , blklen , constV , eps , overlapping );
321+
322+ ret .recomputeNonZeros (k );
323+
326324 if (DMLScript .STATISTICS ) {
327325 final double t = time .stop ();
328326 DMLCompressionStatistics .addDecompressTime (t , k );
0 commit comments