public abstract class ColGroupValue extends ColGroupCompressed implements Cloneable
AColGroup.CompressionType
Modifier and Type | Method and Description |
---|---|
void |
addMinMax(double[] ret) |
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 |
decompressToBlockSafe(MatrixBlock target,
int rl,
int ru,
int offT)
Decompress the contents of this column group into the specified full matrix block while managing the number of
non zeros.
|
void |
decompressToBlockUnSafe(MatrixBlock target,
int rl,
int ru,
int offT)
Decompress the contents of the columngroup unsafely, meaning that it does not count nonzero values.
|
long |
estimateInMemorySize()
Get the upper bound estimate of in memory allocation for the column group.
|
int[] |
getCachedCounts() |
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()
Get the number of nonZeros contained in this column group.
|
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.
|
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 |
setupThreadLocalMemory(int len) |
String |
toString() |
void |
tsmm(double[] result,
int numColumns)
Do a transposed self matrix multiplication on the left side t(x) %*% x.
|
void |
tsmm(double[] result,
int numColumns,
int idxStart,
int idxEnd)
Do a transposed self matrix multiplication on the left side t(x) %*% x.
|
void |
write(DataOutput out)
Serializes column group to data output.
|
getMax, getMin, getNumRows, unaryAggregateOperations, unaryAggregateOperations
binaryRowOp, countNonZerosPerRow, decompressColumnToBlockUnSafe, decompressToBlockUnSafe, get, getColIndices, getCompType, getNumCols, leftMultByMatrix, scalarOperation, shiftColIndices, sliceColumn, sliceColumns
public final void decompressToBlockSafe(MatrixBlock target, int rl, int ru, int offT)
AColGroup
decompressToBlockSafe
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 frompublic final void decompressToBlockUnSafe(MatrixBlock target, int rl, int ru, int offT)
AColGroup
decompressToBlockUnSafe
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 frompublic final int getNumValues()
AColGroup
getNumValues
in class AColGroup
public final double[] getValues()
AColGroup
getValues
in class ColGroupCompressed
public final ADictionary getDictionary()
public final void addMinMax(double[] ret)
addMinMax
in class ColGroupCompressed
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 cleanupThreadLocalMemory()
public String toString()
toString
in class ColGroupCompressed
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 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 final void tsmm(double[] result, int numColumns)
AColGroup
public final void tsmm(double[] result, int numColumns, int idxStart, int idxEnd)
AColGroup
tsmm
in class AColGroup
result
- A row major dense allocation of a matrixBlock, of size [numColumns x numColumns]numColumns
- The number of columns in the row major result matrix.idxStart
- The starting index in the _colIndexes.idxEnd
- The ending index in the _colIndexes.public final boolean containsValue(double pattern)
AColGroup
containsValue
in class AColGroup
pattern
- The value to look for.public final long getNumberNonZeros()
AColGroup
getNumberNonZeros
in class AColGroup
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 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 ColGroupCompressed
Copyright © 2021 The Apache Software Foundation. All rights reserved.