use of org.apache.sysml.runtime.compress.ColGroupUncompressed in project incubator-systemml by apache.
the class ConverterUtils method getUncompressedColBlock.
public static MatrixBlock getUncompressedColBlock(ColGroup group) {
MatrixBlock ret = null;
if (group instanceof ColGroupUncompressed) {
ret = ((ColGroupUncompressed) group).getData();
} else {
ArrayList<ColGroup> tmpGroup = new ArrayList<ColGroup>(Arrays.asList(group));
ColGroupUncompressed decompressedCols = new ColGroupUncompressed(tmpGroup);
ret = decompressedCols.getData();
}
return ret;
}
use of org.apache.sysml.runtime.compress.ColGroupUncompressed in project incubator-systemml by apache.
the class ConverterUtils method copyColGroup.
/**
* Copy col group instance with deep copy of column indices but
* shallow copy of actual contents;
*
* @param group column group
* @return column group (deep copy of indices but shallow copy of contents)
*/
public static ColGroup copyColGroup(ColGroup group) {
ColGroup ret = null;
// deep copy col indices
int[] colIndices = Arrays.copyOf(group.getColIndices(), group.getNumCols());
// create copy of column group
if (group instanceof ColGroupUncompressed) {
ColGroupUncompressed in = (ColGroupUncompressed) group;
ret = new ColGroupUncompressed(colIndices, in.getNumRows(), in.getData());
} else if (group instanceof ColGroupRLE) {
ColGroupRLE in = (ColGroupRLE) group;
ret = new ColGroupRLE(colIndices, in.getNumRows(), in.hasZeros(), in.getValues(), in.getBitmaps(), in.getBitmapOffsets());
} else if (group instanceof ColGroupOLE) {
ColGroupOLE in = (ColGroupOLE) group;
ret = new ColGroupOLE(colIndices, in.getNumRows(), in.hasZeros(), in.getValues(), in.getBitmaps(), in.getBitmapOffsets());
}
return ret;
}
Aggregations