src/main/java/org/apache/sysds/runtime/compress/BitmapEncoder.java
/**
	 * Extract Bitmap from multiple columns together.
	 * 
	 * It counts the instances of rows containing only zero values, but other groups can contain a zero value.
	 * 
	 * @param colIndices The Column indexes to extract the multi-column bit map from.
	 * @param rowReader  A Reader for the columns selected.
	 * @return The Bitmap
	 */
Extract Bitmap from multiple columns together.

It counts the instances of rows containing only zero values, but other groups can contain a zero value.

@param colIndices The Column indexes to extract the multi-column bit map from.
@param rowReader  A Reader for the columns selected.
@return The Bitmap
Extract Bitmap from multiple columns together . It counts the instances of rows containing only zero values but other groups can contain a zero value . @param colIndices The Column indexes to extract the multi - column bit map from . @param rowReader A Reader for the columns selected . @return The Bitmap
private static Bitmap extractBitmap(int[] colIndices, ReaderColumnSelection rowReader) {
		DblArrayIntListHashMap distinctVals;
		if(colIndices.length > 10) {
			distinctVals = new DblArrayIntListHashMap(2048);
		}
		else {
			distinctVals = new DblArrayIntListHashMap();
		}
		DblArray cellVals = null;
		int zero = 0;
		while((cellVals = rowReader.nextRow()) != null) {
			if(cellVals.getData() == null) {
				zero += 1;
			}
			else {
				IntArrayList lstPtr = distinctVals.get(cellVals);
				if(lstPtr == null) {
					lstPtr = new IntArrayList();
					distinctVals.appendValue(new DblArray(cellVals), lstPtr);
				}
				lstPtr.appendValue(rowReader.getCurrentRowIndex());
			}
		}
		return makeBitmap(distinctVals, colIndices.length, zero);
	}
private static Bitmap extractBitmap ( int [ ] colIndices , ReaderColumnSelection rowReader ) { DblArrayIntListHashMap distinctVals ; if ( colIndices . length > 10 ) { distinctVals = new DblArrayIntListHashMap ( 2048 ) ; } else { distinctVals = new DblArrayIntListHashMap ( ) ; } DblArray cellVals = null ; int zero = 0 ; while ( ( cellVals = rowReader . nextRow ( ) ) != null ) { if ( cellVals . getData ( ) == null ) { zero += 1 ; } else { IntArrayList lstPtr = distinctVals . get ( cellVals ) ; if ( lstPtr == null ) { lstPtr = new IntArrayList ( ) ; distinctVals . appendValue ( new DblArray ( cellVals ) , lstPtr ) ; } lstPtr . appendValue ( rowReader . getCurrentRowIndex ( ) ) ; } } return makeBitmap ( distinctVals , colIndices . length , zero ) ; }
Extract Bitmap from multiple columns together.
Extract Bitmap from multiple columns together .
// probe map for distinct items (for value or value groups) // scan rows and probe/build distinct items // create new objects only on demand