public abstract class ColGroupOffset extends ColGroupValue
Modifier and Type | Class and Description |
---|---|
protected class |
ColGroupOffset.OffsetRowIterator |
protected class |
ColGroupOffset.OffsetValueIterator |
protected class |
ColGroupOffset.ZeroValueIterator |
ColGroup.ColGroupRowIterator, ColGroup.CompressionType
Modifier and Type | Field and Description |
---|---|
protected char[] |
_data |
protected int[] |
_ptr
Bitmaps, one per uncompressed value in
ColGroupValue._values . |
protected int[] |
_skiplist |
protected boolean |
_zeros |
static boolean |
ALLOW_CACHE_CONSCIOUS_ROWSUMS |
protected static boolean |
CREATE_SKIPLIST |
protected static int |
READ_CACHE_BLKSZ |
static int |
WRITE_CACHE_BLKSZ |
_values, LOW_LEVEL_OPT, SORT_VALUES_BY_LENGTH
_colIndexes, _numRows
Modifier | Constructor and Description |
---|---|
|
ColGroupOffset() |
protected |
ColGroupOffset(int[] colIndices,
int numRows,
boolean zeros,
double[] values)
Constructor for subclass methods that need to create shallow copies
|
|
ColGroupOffset(int[] colIndices,
int numRows,
UncompressedBitmap ubm)
Main constructor.
|
Modifier and Type | Method and Description |
---|---|
protected abstract void |
computeColSums(MatrixBlock result,
org.apache.sysml.runtime.functionobjects.KahanFunction kplus) |
protected int[] |
computeOffsets(boolean[] ind)
Utility function of sparse-unsafe operations.
|
protected abstract void |
computeRowMxx(MatrixBlock result,
org.apache.sysml.runtime.functionobjects.Builtin builtin,
int rl,
int ru) |
protected abstract void |
computeRowSums(MatrixBlock result,
org.apache.sysml.runtime.functionobjects.KahanFunction kplus,
int rl,
int ru) |
protected abstract void |
computeSum(MatrixBlock result,
org.apache.sysml.runtime.functionobjects.KahanFunction kplus) |
protected abstract boolean[] |
computeZeroIndicatorVector() |
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() |
long |
getExactSizeOnDisk()
Returns the exact serialized size of column group.
|
abstract Iterator<Integer> |
getIterator(int k) |
Iterator<IJV> |
getIterator(int rl,
int ru,
boolean inclZeros,
boolean rowMajor)
Create a column group iterator for a row index range.
|
abstract Iterator<Integer> |
getIterator(int k,
int rl,
int ru) |
boolean |
hasZeros() |
protected int |
len(int k) |
protected double |
mxxValues(int bitmapIx,
org.apache.sysml.runtime.functionobjects.Builtin builtin) |
void |
readFields(DataInput in)
Deserializes column group from data input.
|
protected void |
sumAllValues(double[] b,
double[] c) |
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.
|
allocDVector, allocIVector, applyScalarOp, applyScalarOp, cleanupThreadLocalMemory, computeColMxx, computeMxx, containsAllZeroValue, getCounts, getCounts, getCounts, getCounts, getCounts, getCountsAsBlock, getCountsAsBlock, getNumValues, getValue, getValues, getValuesAsBlock, getValuesSize, leftMultByRowVector, preaggValues, preaggValues, setupThreadLocalMemory, setValues, sumAllValues, sumAllValues, sumValues, sumValues, sumValues, sumValues, unaryAggregateOperations
countNonZerosPerRow, getColIndex, getColIndices, getCompType, getNumCols, getNumRows, getRowIterator, leftMultByRowVector, readFields, rightMultByVector, scalarOperation, shiftColIndices, write
protected static final boolean CREATE_SKIPLIST
protected static final int READ_CACHE_BLKSZ
public static final int WRITE_CACHE_BLKSZ
public static boolean ALLOW_CACHE_CONSCIOUS_ROWSUMS
protected int[] _ptr
ColGroupValue._values
.protected char[] _data
protected boolean _zeros
protected int[] _skiplist
public ColGroupOffset()
public ColGroupOffset(int[] colIndices, int numRows, UncompressedBitmap ubm)
colIndices
- 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 ColGroupOffset(int[] colIndices, int numRows, boolean zeros, double[] values)
colIndices
- raw column index informationnumRows
- number of rows in the blockzeros
- indicator if column group contains zero valuesvalues
- 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 ColGroupValue
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
protected final void sumAllValues(double[] b, double[] c)
protected final double mxxValues(int bitmapIx, org.apache.sysml.runtime.functionobjects.Builtin builtin)
public char[] getBitmaps()
public int[] getBitmapOffsets()
public boolean hasZeros()
protected int[] computeOffsets(boolean[] ind)
ind
- row indicator vector of non zerospublic 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
public void unaryAggregateOperations(org.apache.sysml.runtime.matrix.operators.AggregateUnaryOperator op, MatrixBlock result, int rl, int ru)
unaryAggregateOperations
in class ColGroupValue
op
- aggregation operatorresult
- output matrix blockrl
- row lower index, inclusiveru
- row upper index, exclusiveprotected abstract void computeSum(MatrixBlock result, org.apache.sysml.runtime.functionobjects.KahanFunction kplus)
protected abstract void computeRowSums(MatrixBlock result, org.apache.sysml.runtime.functionobjects.KahanFunction kplus, int rl, int ru)
protected abstract void computeColSums(MatrixBlock result, org.apache.sysml.runtime.functionobjects.KahanFunction kplus)
protected abstract void computeRowMxx(MatrixBlock result, org.apache.sysml.runtime.functionobjects.Builtin builtin, int rl, int ru)
protected abstract boolean[] computeZeroIndicatorVector()
public Iterator<IJV> getIterator(int rl, int ru, boolean inclZeros, boolean rowMajor)
ColGroup
getIterator
in class ColGroup
rl
- row lower index, inclusiveru
- row upper index, exclusiveinclZeros
- include zero values into scope of iteratorrowMajor
- use a row major iteration orderpublic abstract Iterator<Integer> getIterator(int k)
k
- index of value tuple with associated bitmapCopyright © 2018 The Apache Software Foundation. All rights reserved.