use of org.apache.sysml.runtime.compress.utils.DblArray in project systemml by apache.
the class CompressedSizeEstimatorSample method getValCounts.
private static HashMap<DblArray, Integer> getValCounts(ReaderColumnSelection sampleRowsReader) {
HashMap<DblArray, Integer> valsCount = new HashMap<>();
DblArray val = null;
Integer cnt;
while (null != (val = sampleRowsReader.nextRow())) {
cnt = valsCount.get(val);
if (cnt == null)
cnt = 0;
cnt++;
valsCount.put(new DblArray(val), cnt);
}
return valsCount;
}
use of org.apache.sysml.runtime.compress.utils.DblArray in project incubator-systemml by apache.
the class CompressedSizeEstimatorSample method getValCounts.
private static HashMap<DblArray, Integer> getValCounts(ReaderColumnSelection sampleRowsReader) {
HashMap<DblArray, Integer> valsCount = new HashMap<>();
DblArray val = null;
Integer cnt;
while (null != (val = sampleRowsReader.nextRow())) {
cnt = valsCount.get(val);
if (cnt == null)
cnt = 0;
cnt++;
valsCount.put(new DblArray(val), cnt);
}
return valsCount;
}
use of org.apache.sysml.runtime.compress.utils.DblArray 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);
}
use of org.apache.sysml.runtime.compress.utils.DblArray 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);
}
Aggregations