public abstract class ColGroupBitmap extends ColGroup
ColGroup.CompressionType| Modifier and Type | Field and Description |
|---|---|
protected char[] |
_data |
protected int[] |
_ptr
Bitmaps, one per uncompressed value in
_values. |
protected int[] |
_skiplist |
protected double[] |
_values
Distinct values associated with individual bitmaps.
|
protected boolean |
_zeros |
protected static boolean |
CREATE_SKIPLIST |
static boolean |
LOW_LEVEL_OPT |
protected static int |
READ_CACHE_BLKSZ |
protected static int |
WRITE_CACHE_BLKSZ |
_colIndexes, _numRows| Modifier | Constructor and Description |
|---|---|
|
ColGroupBitmap(ColGroup.CompressionType type) |
protected |
ColGroupBitmap(ColGroup.CompressionType type,
int[] colIndices,
int numRows,
boolean zeros,
double[] values)
Constructor for subclass methods that need to create shallow copies
|
|
ColGroupBitmap(ColGroup.CompressionType type,
int[] colIndices,
int numRows,
UncompressedBitmap ubm)
Main constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected double[] |
applyScalarOp(org.apache.sysml.runtime.matrix.operators.ScalarOperator op)
Method for use by subclasses.
|
protected double[] |
applyScalarOp(org.apache.sysml.runtime.matrix.operators.ScalarOperator op,
double newVal,
int numCols) |
protected void |
computeColMxx(MatrixBlock result,
org.apache.sysml.runtime.functionobjects.Builtin builtin)
NOTE: Shared across OLE/RLE because value-only computation.
|
protected void |
computeMxx(MatrixBlock result,
org.apache.sysml.runtime.functionobjects.Builtin builtin)
NOTE: Shared across OLE/RLE because value-only computation.
|
protected int[] |
computeOffsets(boolean[] ind)
Utility function of sparse-unsafe operations.
|
protected void |
createCompressedBitmaps(int numVals,
int totalLen,
char[][] lbitmaps) |
void |
decompressToBlock(MatrixBlock target,
int colpos)
Decompress to block.
|
void |
decompressToBlock(MatrixBlock target,
int[] colIndexTargets)
Decompress the contents of this column group into uncompressed packed
columns
|
void |
decompressToBlock(MatrixBlock target,
int rl,
int ru)
Decompress the contents of this column group into the specified full
matrix block.
|
long |
estimateInMemorySize()
Note: Must be overridden by child classes to account for additional data
and metadata
|
double |
get(int r,
int c)
Get the value at a global row/column position.
|
int[] |
getBitmapOffsets() |
char[] |
getBitmaps() |
abstract Iterator<Integer> |
getDecodeIterator(int k) |
long |
getExactSizeOnDisk()
Returns the exact serialized size of column group.
|
int |
getNumValues()
Obtain number of distrinct sets of values associated with the bitmaps in this column group.
|
double[] |
getValues() |
boolean |
hasZeros() |
protected int |
len(int k) |
protected double |
mxxValues(int bitmapIx,
org.apache.sysml.runtime.functionobjects.Builtin builtin) |
protected double[] |
preaggValues(int numVals,
double[] b) |
void |
readFields(DataInput in)
Deserializes column group from data input.
|
protected double |
sumValues(int bitmapIx) |
protected double |
sumValues(int bitmapIx,
double[] b) |
abstract void |
unaryAggregateOperations(org.apache.sysml.runtime.matrix.operators.AggregateUnaryOperator op,
MatrixBlock result,
int rl,
int ru) |
void |
write(DataOutput out)
Serializes column group to data output.
|
countNonZerosPerRow, getColIndex, getColIndices, getCompType, getNumCols, getNumRows, leftMultByRowVector, rightMultByVector, scalarOperation, shiftColIndices, unaryAggregateOperationspublic static final boolean LOW_LEVEL_OPT
protected static final boolean CREATE_SKIPLIST
protected static final int READ_CACHE_BLKSZ
protected static final int WRITE_CACHE_BLKSZ
protected double[] _values
protected int[] _ptr
_values.protected char[] _data
protected boolean _zeros
protected int[] _skiplist
public ColGroupBitmap(ColGroup.CompressionType type)
public ColGroupBitmap(ColGroup.CompressionType type, int[] colIndices, int numRows, UncompressedBitmap ubm)
type - column typecolIndices - indices (within the block) of the columns included in this
columnnumRows - total number of rows in the parent blockubm - Uncompressed bitmap representation of the blockprotected ColGroupBitmap(ColGroup.CompressionType type, int[] colIndices, int numRows, boolean zeros, double[] values)
type - compression typecolIndices - raw column index informationnumRows - number of rows in the blockzeros - ?values - set of distinct values for the block (associated bitmaps are
kept in the subclass)protected final int len(int k)
protected void createCompressedBitmaps(int numVals,
int totalLen,
char[][] lbitmaps)
public long estimateInMemorySize()
ColGroupestimateInMemorySize in class ColGrouppublic void decompressToBlock(MatrixBlock target, int rl, int ru)
ColGroupdecompressToBlock in class ColGrouptarget - a matrix block where the columns covered by this column group
have not yet been filled in.rl - row lowerru - row upperpublic void decompressToBlock(MatrixBlock target, int[] colIndexTargets)
ColGroupdecompressToBlock in class ColGrouptarget - a dense matrix block. The block must have enough space to hold
the contents of this column group.colIndexTargets - array that maps column indices in the original matrix block to
columns of target.public void decompressToBlock(MatrixBlock target, int colpos)
ColGroupdecompressToBlock in class ColGrouptarget - dense output vectorcolpos - column to decompress, error if larger or equal numColspublic double get(int r,
int c)
ColGrouppublic abstract void unaryAggregateOperations(org.apache.sysml.runtime.matrix.operators.AggregateUnaryOperator op,
MatrixBlock result,
int rl,
int ru)
throws DMLRuntimeException
DMLRuntimeExceptionprotected final double sumValues(int bitmapIx)
protected final double sumValues(int bitmapIx,
double[] b)
protected final double mxxValues(int bitmapIx,
org.apache.sysml.runtime.functionobjects.Builtin builtin)
protected final double[] preaggValues(int numVals,
double[] b)
protected double[] applyScalarOp(org.apache.sysml.runtime.matrix.operators.ScalarOperator op)
throws DMLRuntimeException
op - scalar operation to performDMLRuntimeException - if DMLRuntimeException occursprotected double[] applyScalarOp(org.apache.sysml.runtime.matrix.operators.ScalarOperator op,
double newVal,
int numCols)
throws DMLRuntimeException
DMLRuntimeExceptionprotected void computeMxx(MatrixBlock result, org.apache.sysml.runtime.functionobjects.Builtin builtin)
result - matrix blockbuiltin - ?protected void computeColMxx(MatrixBlock result, org.apache.sysml.runtime.functionobjects.Builtin builtin)
result - matrix blockbuiltin - ?public int getNumValues()
public double[] getValues()
public char[] getBitmaps()
public int[] getBitmapOffsets()
public boolean hasZeros()
public abstract Iterator<Integer> getDecodeIterator(int k)
k - index of a specific compressed bitmap (stored in subclass,
index same as getValues())protected int[] computeOffsets(boolean[] ind)
throws DMLRuntimeException
ind - ?DMLRuntimeException - if DMLRuntimeException occurspublic void readFields(DataInput in) throws IOException
ColGroupreadFields in class ColGroupin - data inputIOException - if IOException occurspublic void write(DataOutput out) throws IOException
ColGroupwrite in class ColGroupout - data outputIOException - if IOException occurspublic long getExactSizeOnDisk()
ColGroupgetExactSizeOnDisk in class ColGroupCopyright © 2017 The Apache Software Foundation. All rights reserved.