public class ColGroupEmpty extends ColGroupCompressed
AColGroup.CompressionType
Constructor and Description |
---|
ColGroupEmpty(int[] colIndices)
Constructs an Constant Colum Group, that contains only one tuple, with the given value.
|
Modifier and Type | Method and Description |
---|---|
AColGroup |
binaryRowOp(BinaryOperator op,
double[] v,
boolean sparseSafe,
boolean left)
Perform a binary row operation.
|
void |
computeColSums(double[] c,
int nRows)
Compute the column sum
|
boolean |
containsValue(double pattern)
Detect if the column group contains a specific value.
|
AColGroup |
copy()
Get a copy of this column group.
|
void |
countNonZerosPerRow(int[] rnnz,
int rl,
int ru)
Count the number of non-zeros per row
|
void |
decompressToBlock(MatrixBlock target,
int rl,
int ru,
int offT)
Decompress the contents of the column group without counting non zeros
|
static ColGroupEmpty |
generate(int nCol) |
double |
get(int r,
int c)
Get the value at a global row/column position.
|
org.apache.sysds.runtime.compress.colgroup.AColGroup.ColGroupType |
getColGroupType()
Internally get the specific type of ColGroup, this could be extracted from the object but that does not allow for
nice switches in the code.
|
AColGroup.CompressionType |
getCompType()
Obtain the compression type.
|
double |
getMax()
Short hand method for getting maximum value contained in this column group.
|
double |
getMin()
Short hand method for getting minimum value contained in this column group.
|
long |
getNumberNonZeros(int nRows)
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 c)
Left side matrix multiplication with a column group that is transposed.
|
void |
leftMultByMatrix(MatrixBlock a,
MatrixBlock c,
int rl,
int ru)
Left multiply with this column group.
|
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.
|
AColGroup |
scalarOperation(ScalarOperator op)
Perform the specified scalar operation directly on the compressed column group, without decompressing individual
cells if possible.
|
void |
tsmmAColGroup(AColGroup other,
MatrixBlock result)
Matrix multiply with this other column group, but:
1.
|
tsmm, unaryAggregateOperations
colSum, decompressToBlock, estimateInMemorySize, getColIndices, getExactSizeOnDisk, getNumCols, leftMultByMatrix, readFields, shiftColIndices, sliceColumn, sliceColumns, toString, write
public ColGroupEmpty(int[] colIndices)
colIndices
- The Colum indexes for the column group.public static ColGroupEmpty generate(int nCol)
public AColGroup.CompressionType getCompType()
AColGroup
getCompType
in class AColGroup
public org.apache.sysds.runtime.compress.colgroup.AColGroup.ColGroupType getColGroupType()
AColGroup
public 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 double get(int r, int c)
AColGroup
public AColGroup scalarOperation(ScalarOperator op)
AColGroup
scalarOperation
in class AColGroup
op
- operation to performpublic AColGroup binaryRowOp(BinaryOperator op, double[] v, boolean sparseSafe, boolean left)
AColGroup
binaryRowOp
in class AColGroup
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 containedpublic void countNonZerosPerRow(int[] rnnz, int rl, int ru)
AColGroup
countNonZerosPerRow
in class AColGroup
rnnz
- non-zeros per rowrl
- row lower bound, inclusiveru
- row upper bound, exclusivepublic int getNumValues()
AColGroup
getNumValues
in class AColGroup
public double[] getValues()
AColGroup
getValues
in class ColGroupCompressed
public boolean isLossy()
AColGroup
isLossy
in class ColGroupCompressed
public MatrixBlock getValuesAsBlock()
AColGroup
getValuesAsBlock
in class AColGroup
public void leftMultByMatrix(MatrixBlock a, MatrixBlock c, int rl, int ru)
AColGroup
leftMultByMatrix
in class AColGroup
a
- The matrix to multiply with on the leftc
- 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 void leftMultByAColGroup(AColGroup lhs, MatrixBlock c)
AColGroup
leftMultByAColGroup
in class AColGroup
lhs
- The left hand side Column group to multiply with, the left hand side should be considered
transposed.c
- 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 boolean isDense()
AColGroup
public AColGroup copy()
AColGroup
public boolean containsValue(double pattern)
AColGroup
containsValue
in class AColGroup
pattern
- The value to look for.public 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 AColGroup rightMultByMatrix(MatrixBlock right)
AColGroup
rightMultByMatrix
in class AColGroup
right
- The matrixBlock on the right of this matrix multiplicationpublic AColGroup replace(double pattern, double replace)
AColGroup
public final double getMin()
AColGroup
getMin
in class ColGroupCompressed
public final double getMax()
AColGroup
getMax
in class ColGroupCompressed
public void computeColSums(double[] c, int nRows)
AColGroup
computeColSums
in class ColGroupCompressed
c
- The array to add the column sum to.nRows
- The number of rows in the column group.Copyright © 2021 The Apache Software Foundation. All rights reserved.