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, unaryAggregateOperations
public 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()
ColGroup
estimateInMemorySize
in class ColGroup
public void decompressToBlock(MatrixBlock target, int rl, int ru)
ColGroup
decompressToBlock
in class ColGroup
target
- 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)
ColGroup
decompressToBlock
in class ColGroup
target
- 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)
ColGroup
decompressToBlock
in class ColGroup
target
- dense output vectorcolpos
- column to decompress, error if larger or equal numColspublic double get(int r, int c)
ColGroup
public abstract void unaryAggregateOperations(org.apache.sysml.runtime.matrix.operators.AggregateUnaryOperator op, MatrixBlock result, int rl, int ru) throws DMLRuntimeException
DMLRuntimeException
protected 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
DMLRuntimeException
protected 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
ColGroup
readFields
in class ColGroup
in
- data inputIOException
- if IOException occurspublic void write(DataOutput out) throws IOException
ColGroup
write
in class ColGroup
out
- data outputIOException
- if IOException occurspublic long getExactSizeOnDisk()
ColGroup
getExactSizeOnDisk
in class ColGroup
Copyright © 2017 The Apache Software Foundation. All rights reserved.