public abstract class ColGroupValue extends ColGroupCompressed implements Cloneable
AColGroup.CompressionType
Modifier and Type | Method and Description |
---|---|
void |
addMatrixToResult(MatrixBlock tmp,
MatrixBlock result,
int rl,
int ru) |
static MatrixBlock |
allocatePreAggregate(MatrixBlock m,
int numVals,
int rl,
int ru) |
static void |
cleanupThreadLocalMemory() |
boolean |
containsValue(double pattern)
Detect if the column group contains a specific value.
|
ColGroupValue |
copy()
Get a copy of this column group.
|
AColGroup |
copyAndSet(ADictionary newDictionary) |
AColGroup |
copyAndSet(double[] newDictionary) |
AColGroup |
copyAndSet(int[] colIndexes,
ADictionary newDictionary) |
AColGroup |
copyAndSet(int[] colIndexes,
double[] newDictionary) |
void |
decompressToBlock(MatrixBlock target,
int rl,
int ru,
int offT)
Decompress the contents of the column group without counting non zeros
|
long |
estimateInMemorySize()
Get the upper bound estimate of in memory allocation for the column group.
|
int[] |
getCachedCounts()
Get the cached counts.
|
int[] |
getCounts()
Returns the counts of values inside the dictionary.
|
abstract int[] |
getCounts(int[] out) |
int[] |
getCounts(int rl,
int ru)
Returns the counts of values inside the MatrixBlock returned in getValuesAsBlock Throws an exception if the
getIfCountsType is false.
|
abstract int[] |
getCounts(int rl,
int ru,
int[] out) |
ADictionary |
getDictionary() |
long |
getExactSizeOnDisk()
Returns the exact serialized size of column group.
|
boolean |
getIfCountsType() |
long |
getNumberNonZeros(int nRows)
Get the number of nonZeros contained in this column group.
|
int |
getNumRows() |
int |
getNumValues()
Obtain number of distinct tuples in contained sets of values associated with this column group.
|
double[] |
getValues()
Get all the values in the colGroup.
|
MatrixBlock |
getValuesAsBlock()
Returns the ColGroup as a MatrixBlock.
|
boolean |
isDense()
Is dense, signals that the entire column group is allocated an processed.
|
boolean |
isLossy()
Is Lossy
|
void |
leftMultByAColGroup(AColGroup lhs,
MatrixBlock result)
Left side matrix multiplication with a column group that is transposed.
|
void |
leftMultByMatrix(MatrixBlock matrix,
MatrixBlock result,
int rl,
int ru)
Multiply with a matrix on the left.
|
MatrixBlock |
leftMultByPreAggregateMatrix(MatrixBlock preAgg) |
MatrixBlock |
leftMultByPreAggregateMatrix(MatrixBlock preAgg,
MatrixBlock tmpRes) |
abstract void |
preAggregate(MatrixBlock m,
MatrixBlock preAgg,
int rl,
int ru)
Pre aggregate for left Multiplication.
|
abstract void |
preAggregateDense(MatrixBlock m,
MatrixBlock preAgg,
int rl,
int ru,
int vl,
int vu) |
Dictionary |
preAggregateThatIndexStructure(ColGroupValue that,
boolean preModify)
Pre aggregate into a dictionary.
|
void |
readFields(DataInput in)
Deserialize column group from data input.
|
AColGroup |
replace(double pattern,
double replace)
Make a copy of the column group values, and replace all values that match pattern with replacement value.
|
AColGroup |
rightMultByMatrix(MatrixBlock right)
Right matrix multiplication with this column group.
|
static void |
setupLeftMultThreadLocalMemory(int len) |
static void |
setupThreadLocalMemory(int len) |
String |
toString() |
void |
tsmmAColGroup(AColGroup other,
MatrixBlock result)
Matrix multiply with this other column group, but:
1.
|
void |
write(DataOutput out)
Serializes column group to data output.
|
computeColSums, getMax, getMin, tsmm, unaryAggregateOperations
binaryRowOp, colSum, countNonZerosPerRow, decompressToBlock, get, getColIndices, getCompType, getNumCols, leftMultByMatrix, scalarOperation, shiftColIndices, sliceColumn, sliceColumns
public final void decompressToBlock(MatrixBlock target, int rl, int ru, int offT)
AColGroup
decompressToBlock
in class AColGroup
target
- a matrix block where the columns covered by this column group have not yet been filled in.rl
- row lowerru
- row upperoffT
- Offset into target to assign from, this allows us to decompress into smaller matrices.public final int getNumValues()
AColGroup
getNumValues
in class AColGroup
public final double[] getValues()
AColGroup
getValues
in class ColGroupCompressed
public final ADictionary getDictionary()
public final MatrixBlock getValuesAsBlock()
AColGroup
getValuesAsBlock
in class AColGroup
public final int[] getCounts()
public final int[] getCachedCounts()
public final int[] getCounts(int rl, int ru)
rl
- the lower index of the interval of rows queriedru
- the the upper boundary of the interval of rows queriedpublic boolean getIfCountsType()
public static void setupThreadLocalMemory(int len)
public static void setupLeftMultThreadLocalMemory(int len)
public static void cleanupThreadLocalMemory()
public final boolean isLossy()
AColGroup
isLossy
in class ColGroupCompressed
public void readFields(DataInput in) throws IOException
AColGroup
readFields
in class AColGroup
in
- data inputIOException
- if IOException occurspublic void write(DataOutput out) throws IOException
AColGroup
write
in class AColGroup
out
- data outputIOException
- if IOException occurspublic long getExactSizeOnDisk()
AColGroup
getExactSizeOnDisk
in class AColGroup
public abstract int[] getCounts(int[] out)
public abstract int[] getCounts(int rl, int ru, int[] out)
public AColGroup copyAndSet(double[] newDictionary)
public AColGroup copyAndSet(ADictionary newDictionary)
public AColGroup copyAndSet(int[] colIndexes, double[] newDictionary)
public AColGroup copyAndSet(int[] colIndexes, ADictionary newDictionary)
public ColGroupValue copy()
AColGroup
public static final MatrixBlock allocatePreAggregate(MatrixBlock m, int numVals, int rl, int ru)
public abstract void preAggregate(MatrixBlock m, MatrixBlock preAgg, int rl, int ru)
m
- Matrix to preAggregatepreAgg
- Matrix to preAggregate intorl
- Start rowru
- End rowpublic abstract void preAggregateDense(MatrixBlock m, MatrixBlock preAgg, int rl, int ru, int vl, int vu)
public final Dictionary preAggregateThatIndexStructure(ColGroupValue that, boolean preModify)
that
- the other column group whose indexes are used for aggregation.preModify
- specifies if the matrix in thispublic final void leftMultByAColGroup(AColGroup lhs, MatrixBlock result)
AColGroup
leftMultByAColGroup
in class AColGroup
lhs
- The left hand side Column group to multiply with, the left hand side should be considered
transposed.result
- The result matrix to insert the result of the multiplication intopublic void tsmmAColGroup(AColGroup other, MatrixBlock result)
AColGroup
tsmmAColGroup
in class AColGroup
other
- The other Column group to multiply withresult
- The result matrix to put the results intopublic final boolean containsValue(double pattern)
AColGroup
containsValue
in class AColGroup
pattern
- The value to look for.public final long getNumberNonZeros(int nRows)
AColGroup
getNumberNonZeros
in class AColGroup
nRows
- The number of rows in the column group, this is used for groups that does not contain information
about how many rows they have.public final boolean isDense()
AColGroup
public final void leftMultByMatrix(MatrixBlock matrix, MatrixBlock result, int rl, int ru)
leftMultByMatrix
in class AColGroup
matrix
- matrix to left multiplyresult
- matrix block resultrl
- The row to start the matrix multiplication fromru
- The row to stop the matrix multiplication at.public final MatrixBlock leftMultByPreAggregateMatrix(MatrixBlock preAgg)
public final MatrixBlock leftMultByPreAggregateMatrix(MatrixBlock preAgg, MatrixBlock tmpRes)
public void addMatrixToResult(MatrixBlock tmp, MatrixBlock result, int rl, int ru)
public final AColGroup rightMultByMatrix(MatrixBlock right)
AColGroup
rightMultByMatrix
in class AColGroup
right
- The matrixBlock on the right of this matrix multiplicationpublic long estimateInMemorySize()
AColGroup
estimateInMemorySize
in class AColGroup
public AColGroup replace(double pattern, double replace)
AColGroup
public final int getNumRows()
Copyright © 2021 The Apache Software Foundation. All rights reserved.