public abstract class AColGroup extends Object implements Serializable
Modifier and Type | Class and Description |
---|---|
static class |
AColGroup.CompressionType
Public super types of compression ColGroups supported
|
Modifier and Type | Method and Description |
---|---|
abstract AColGroup |
binaryRowOp(BinaryOperator op,
double[] v,
boolean sparseSafe,
boolean left)
Perform a binary row operation.
|
abstract boolean |
containsValue(double pattern)
Detect if the column group contains a specific value.
|
abstract AColGroup |
copy()
Get a copy of this column group.
|
abstract void |
countNonZerosPerRow(int[] rnnz,
int rl,
int ru)
Count the number of non-zeros per row
|
static void |
decompressColumnToBlockUnSafe(MatrixBlock target,
int rl,
int ru,
List<AColGroup> colGroups)
Decompress part of the col groups into the target matrix block, this decompression maintain the number of non
zeros.
|
abstract 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)
Decompress the contents of the columngroup unsafely, meaning that it does not count nonzero values.
|
abstract 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.
|
abstract double |
get(int r,
int c)
Get the value at a global row/column position.
|
int[] |
getColIndices()
Obtain the offsets of the columns in the matrix block that make up the group
|
abstract AColGroup.CompressionType |
getCompType()
Obtain the compression type.
|
long |
getExactSizeOnDisk()
Returns the exact serialized size of column group.
|
abstract double |
getMax()
Short hand method for getting maximum value contained in this column group.
|
abstract double |
getMin()
Short hand method for getting minimum value contained in this column group.
|
abstract long |
getNumberNonZeros()
Get the number of nonZeros contained in this column group.
|
int |
getNumCols()
Obtain the number of columns in this column group.
|
abstract int |
getNumRows()
Get number of rows contained in the ColGroup.
|
abstract int |
getNumValues()
Obtain number of distinct tuples in contained sets of values associated with this column group.
|
abstract double[] |
getValues()
Get all the values in the colGroup.
|
abstract MatrixBlock |
getValuesAsBlock()
Returns the ColGroup as a MatrixBlock.
|
abstract boolean |
isDense()
Is dense, signals that the entire column group is allocated an processed.
|
abstract boolean |
isLossy()
Is Lossy
|
abstract void |
leftMultByAColGroup(AColGroup lhs,
MatrixBlock result)
Left side matrix multiplication with a column group that is transposed.
|
void |
leftMultByMatrix(MatrixBlock matrix,
MatrixBlock result)
Left multiply with this column group
|
abstract void |
leftMultByMatrix(MatrixBlock matrix,
MatrixBlock result,
int rl,
int ru)
Left multiply with this column group.
|
void |
readFields(DataInput in)
Deserialize column group from data input.
|
abstract AColGroup |
replace(double pattern,
double replace)
Make a copy of the column group values, and replace all values that match pattern with replacement value.
|
abstract AColGroup |
rightMultByMatrix(MatrixBlock right)
Right matrix multiplication with this column group.
|
abstract AColGroup |
scalarOperation(ScalarOperator op)
Perform the specified scalar operation directly on the compressed column group, without decompressing individual
cells if possible.
|
void |
shiftColIndices(int offset)
Shift all column indexes contained by an offset.
|
AColGroup |
sliceColumn(int col)
Slice out a single column from the column group.
|
AColGroup |
sliceColumns(int cl,
int cu)
Slice out the columns within the range of cl and cu to remove the dictionary values related to these columns.
|
String |
toString() |
abstract void |
tsmm(double[] result,
int numColumns)
Do a transposed self matrix multiplication on the left side t(x) %*% x.
|
abstract void |
tsmm(double[] result,
int numColumns,
int idxStart,
int idxEnd)
Do a transposed self matrix multiplication on the left side t(x) %*% x.
|
abstract void |
unaryAggregateOperations(AggregateUnaryOperator op,
double[] c)
Unary Aggregate operator, since aggregate operators require new object output, the output becomes an uncompressed
matrix.
|
abstract void |
unaryAggregateOperations(AggregateUnaryOperator op,
double[] c,
int rl,
int ru)
Unary Aggregate operator, since aggregate operators require new object output, the output becomes an uncompressed
matrix.
|
void |
write(DataOutput out)
Serializes column group to data output.
|
public int[] getColIndices()
public abstract int getNumRows()
public abstract int getNumValues()
public int getNumCols()
public abstract AColGroup.CompressionType getCompType()
public final void shiftColIndices(int offset)
offset
- The offset to move all columnspublic long estimateInMemorySize()
public abstract void decompressToBlockSafe(MatrixBlock target, int rl, int ru, int offT)
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 void decompressToBlockUnSafe(MatrixBlock target, int rl, int ru)
target
- a matrix block where the columns covered by this column group have not yet been filled in.rl
- row lowerru
- row upperpublic abstract void decompressToBlockUnSafe(MatrixBlock target, int rl, int ru, int offT)
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 static final void decompressColumnToBlockUnSafe(MatrixBlock target, int rl, int ru, List<AColGroup> colGroups)
target
- The Target matrix block to decompress intorl
- The row to start the decompression fromru
- The row to end the decompression atcolGroups
- The list of column groups to decompress.public void write(DataOutput out) throws IOException
out
- data outputIOException
- if IOException occurspublic void readFields(DataInput in) throws IOException
in
- data inputIOException
- if IOException occurspublic long getExactSizeOnDisk()
public abstract double get(int r, int c)
r
- rowc
- columnpublic abstract double[] getValues()
public abstract MatrixBlock getValuesAsBlock()
public abstract AColGroup rightMultByMatrix(MatrixBlock right)
right
- The matrixBlock on the right of this matrix multiplicationpublic abstract void tsmm(double[] result, int numColumns)
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.public abstract void tsmm(double[] result, int numColumns, int idxStart, int idxEnd)
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 void leftMultByMatrix(MatrixBlock matrix, MatrixBlock result)
matrix
- The matrix to multiply with on the leftresult
- The result to output the values into, always dense for the purpose of the column groups
parallelizingpublic abstract void leftMultByMatrix(MatrixBlock matrix, MatrixBlock result, int rl, int ru)
matrix
- The matrix to multiply with on the leftresult
- The result to output the values into, always dense for the purpose of the column groups
parallelizingrl
- The row to begin the multiplication from on the lhs matrixru
- The row to end the multiplication at on the lhs matrixpublic abstract void leftMultByAColGroup(AColGroup lhs, MatrixBlock result)
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 abstract AColGroup scalarOperation(ScalarOperator op)
op
- operation to performpublic abstract AColGroup binaryRowOp(BinaryOperator op, double[] v, boolean sparseSafe, boolean left)
op
- The operation to executev
- The vector of values to apply, should be same length as dictionary length.sparseSafe
- True if the operation return 0 on all instances of values in v -- op(v[?], 0)left
- Specifies if the operation is executed on the left or right side of the values contained.public abstract void unaryAggregateOperations(AggregateUnaryOperator op, double[] c)
op
- The operator usedc
- Rhe output matrix block.public abstract void unaryAggregateOperations(AggregateUnaryOperator op, double[] c, int rl, int ru)
op
- The operator usedc
- The output matrix block.rl
- The Starting Row to do aggregation fromru
- The last Row to do aggregation to (not included)public abstract void countNonZerosPerRow(int[] rnnz, int rl, int ru)
rnnz
- non-zeros per rowrl
- row lower bound, inclusiveru
- row upper bound, exclusivepublic abstract boolean isLossy()
public abstract boolean isDense()
public final AColGroup sliceColumns(int cl, int cu)
cl
- The lower bound of the columns to selectcu
- The upper bound of the columns to select (not inclusive).public final AColGroup sliceColumn(int col)
col
- The column to slice, the column could potentially not be inside the column grouppublic abstract double getMin()
public abstract double getMax()
public abstract AColGroup copy()
public abstract boolean containsValue(double pattern)
pattern
- The value to look for.public abstract long getNumberNonZeros()
public abstract AColGroup replace(double pattern, double replace)
pattern
- The value to look forreplace
- The value to replace the other value withCopyright © 2021 The Apache Software Foundation. All rights reserved.