Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public abstract class AColGroup implements Serializable {
/** Public super types of compression ColGroups supported */
public static enum CompressionType {
UNCOMPRESSED, RLE, OLE, DDC, CONST, EMPTY, SDC, SDCFOR, DDCFOR, DeltaDDC, DDCLZW, LinearFunctional,
PiecewiseLinear, PiecewiseLinearSuccessive;
PiecewiseLinearCompressed;

public boolean isDense() {
return this == DDC || this == CONST || this == DDCFOR || this == DDCFOR || this == DDCLZW;
Expand All @@ -88,7 +88,7 @@ public boolean isSDC() {
*/
protected static enum ColGroupType {
UNCOMPRESSED, RLE, OLE, DDC, CONST, EMPTY, SDC, SDCSingle, SDCSingleZeros, SDCZeros, SDCFOR, DDCFOR, DeltaDDC,
LinearFunctional, PiecewiseLinear;
LinearFunctional, PiecewiseLinearCompressed, DDCLZW;
}

/** The ColGroup indexes contained in the ColGroup */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,12 +308,9 @@ else if(ct == CompressionType.LinearFunctional) {
return compressLinearFunctional(colIndexes, in, cs);
}
}
else if(ct == CompressionType.PiecewiseLinear) {
else if(ct == CompressionType.PiecewiseLinearCompressed) {
return compressPiecewiseLinearFunctional(colIndexes, in, cs);
}
else if(ct == CompressionType.PiecewiseLinearSuccessive) {
return compressPiecewiseLinearFunctionalSuccessive(colIndexes, in, cs);
}
else if(ct == CompressionType.DDCFOR) {
AColGroup g = directCompressDDC(colIndexes, cg);
if(g instanceof ColGroupDDC)
Expand Down Expand Up @@ -1110,7 +1107,7 @@ public static AColGroup compressPiecewiseLinearFunctional(IColIndex colIndexes,
for(int col = 0; col < numCols; col++) {
final int colIdx = colIndexes.get(col);
double[] column = PiecewiseLinearUtils.getColumn(in, colIdx);
PiecewiseLinearUtils.SegmentedRegression fit = PiecewiseLinearUtils.compressSegmentedLeastSquares(column,
PiecewiseLinearUtils.SegmentedRegression fit = PiecewiseLinearUtils.compressSuccessivePiecewiseLinear(column,
cs);
breakpointsPerCol[col] = fit.getBreakpoints();
interceptsPerCol[col] = fit.getIntercepts();
Expand All @@ -1124,25 +1121,7 @@ public static AColGroup compressPiecewiseLinearFunctional(IColIndex colIndexes,

public static AColGroup compressPiecewiseLinearFunctionalSuccessive(IColIndex colIndexes, MatrixBlock in,
CompressionSettings cs) {
final int numRows = in.getNumRows();
final int numCols = colIndexes.size();
int[][] breakpointsPerCol = new int[numCols][];
double[][] slopesPerCol = new double[numCols][];
double[][] interceptsPerCol = new double[numCols][];

for(int col = 0; col < numCols; col++) {
final int colIdx = colIndexes.get(col);
double[] column = PiecewiseLinearUtils.getColumn(in, colIdx);
PiecewiseLinearUtils.SegmentedRegression fit = PiecewiseLinearUtils.compressSuccessivePiecewiseLinear(
column, cs);
breakpointsPerCol[col] = fit.getBreakpoints();
interceptsPerCol[col] = fit.getIntercepts();
slopesPerCol[col] = fit.getSlopes();

}
return ColGroupPiecewiseLinearCompressed.create(colIndexes, breakpointsPerCol, slopesPerCol, interceptsPerCol,
numRows);

return compressPiecewiseLinearFunctional(colIndexes, in, cs);
}

private AColGroup compressSDCFromSparseTransposedBlock(IColIndex cols, int nrUniqueEstimate, double tupleSparsity) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ public static AColGroup readColGroup(DataInput in, int nRows) throws IOException
return ColGroupDeltaDDC.read(in);
case DDCLZW:
return ColGroupDDCLZW.read(in);
case PiecewiseLinearCompressed:
return ColGroupPiecewiseLinearCompressed.read(in);
case OLE:
return ColGroupOLE.read(in, nRows);
case RLE:
Expand Down
Loading