Search in sources :

Example 1 with DblArrayIntListHashMap

use of org.apache.sysml.runtime.compress.utils.DblArrayIntListHashMap in project incubator-systemml by apache.

the class BitmapEncoder method extractBitmap.

private static UncompressedBitmap extractBitmap(int[] colIndices, MatrixBlock rawblock, ReaderColumnSelection rowReader) {
    // probe map for distinct items (for value or value groups)
    DblArrayIntListHashMap distinctVals = new DblArrayIntListHashMap();
    // scan rows and probe/build distinct items
    DblArray cellVals = null;
    while ((cellVals = rowReader.nextRow()) != null) {
        IntArrayList lstPtr = distinctVals.get(cellVals);
        if (lstPtr == null) {
            // create new objects only on demand
            lstPtr = new IntArrayList();
            distinctVals.appendValue(new DblArray(cellVals), lstPtr);
        }
        lstPtr.appendValue(rowReader.getCurrentRowIndex());
    }
    return new UncompressedBitmap(distinctVals, colIndices.length);
}
Also used : DblArray(org.apache.sysml.runtime.compress.utils.DblArray) IntArrayList(org.apache.sysml.runtime.compress.utils.IntArrayList) DblArrayIntListHashMap(org.apache.sysml.runtime.compress.utils.DblArrayIntListHashMap)

Example 2 with DblArrayIntListHashMap

use of org.apache.sysml.runtime.compress.utils.DblArrayIntListHashMap in project systemml by apache.

the class BitmapEncoder method extractBitmap.

private static UncompressedBitmap extractBitmap(int[] colIndices, MatrixBlock rawblock, ReaderColumnSelection rowReader) {
    // probe map for distinct items (for value or value groups)
    DblArrayIntListHashMap distinctVals = new DblArrayIntListHashMap();
    // scan rows and probe/build distinct items
    DblArray cellVals = null;
    while ((cellVals = rowReader.nextRow()) != null) {
        IntArrayList lstPtr = distinctVals.get(cellVals);
        if (lstPtr == null) {
            // create new objects only on demand
            lstPtr = new IntArrayList();
            distinctVals.appendValue(new DblArray(cellVals), lstPtr);
        }
        lstPtr.appendValue(rowReader.getCurrentRowIndex());
    }
    return new UncompressedBitmap(distinctVals, colIndices.length);
}
Also used : DblArray(org.apache.sysml.runtime.compress.utils.DblArray) IntArrayList(org.apache.sysml.runtime.compress.utils.IntArrayList) DblArrayIntListHashMap(org.apache.sysml.runtime.compress.utils.DblArrayIntListHashMap)

Aggregations

DblArray (org.apache.sysml.runtime.compress.utils.DblArray)2 DblArrayIntListHashMap (org.apache.sysml.runtime.compress.utils.DblArrayIntListHashMap)2 IntArrayList (org.apache.sysml.runtime.compress.utils.IntArrayList)2