Class CompressedMatrixBlockFactory
- java.lang.Object
-
- org.apache.sysds.runtime.compress.CompressedMatrixBlockFactory
-
public class CompressedMatrixBlockFactory extends Object
Factory pattern to compress a Matrix Block into a CompressedMatrixBlock.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.apache.commons.lang3.tuple.Pair<MatrixBlock,CompressionStatistics>
compress(MatrixBlock mb)
Default sequential compression with no parallelizationstatic org.apache.commons.lang3.tuple.Pair<MatrixBlock,CompressionStatistics>
compress(MatrixBlock mb, int k)
static org.apache.commons.lang3.tuple.Pair<MatrixBlock,CompressionStatistics>
compress(MatrixBlock mb, int k, CompressionSettingsBuilder compSettings)
static org.apache.commons.lang3.tuple.Pair<MatrixBlock,CompressionStatistics>
compress(MatrixBlock mb, int k, CompressionSettingsBuilder compSettings, ACostEstimate costEstimator)
static org.apache.commons.lang3.tuple.Pair<MatrixBlock,CompressionStatistics>
compress(MatrixBlock mb, int k, CompressionSettingsBuilder compSettings, CostEstimatorBuilder csb)
The main method for compressing the input matrix.static org.apache.commons.lang3.tuple.Pair<MatrixBlock,CompressionStatistics>
compress(MatrixBlock mb, int k, CompressionSettingsBuilder compSettings, WTreeRoot root)
The main method for compressing the input matrix.static org.apache.commons.lang3.tuple.Pair<MatrixBlock,CompressionStatistics>
compress(MatrixBlock mb, int k, ACostEstimate costEstimator)
static org.apache.commons.lang3.tuple.Pair<MatrixBlock,CompressionStatistics>
compress(MatrixBlock mb, int k, CostEstimatorBuilder csb)
static org.apache.commons.lang3.tuple.Pair<MatrixBlock,CompressionStatistics>
compress(MatrixBlock mb, int k, InstructionTypeCounter ins)
static org.apache.commons.lang3.tuple.Pair<MatrixBlock,CompressionStatistics>
compress(MatrixBlock mb, int k, WTreeRoot root)
static org.apache.commons.lang3.tuple.Pair<MatrixBlock,CompressionStatistics>
compress(MatrixBlock mb, CompressionSettingsBuilder customSettings)
static org.apache.commons.lang3.tuple.Pair<MatrixBlock,CompressionStatistics>
compress(MatrixBlock mb, ACostEstimate costEstimator)
static org.apache.commons.lang3.tuple.Pair<MatrixBlock,CompressionStatistics>
compress(MatrixBlock mb, CostEstimatorBuilder csb)
static org.apache.commons.lang3.tuple.Pair<MatrixBlock,CompressionStatistics>
compress(MatrixBlock mb, InstructionTypeCounter ins)
static org.apache.commons.lang3.tuple.Pair<MatrixBlock,CompressionStatistics>
compress(MatrixBlock mb, WTreeRoot root)
static void
compressAsync(ExecutionContext ec, String varName)
static void
compressAsync(ExecutionContext ec, String varName, InstructionTypeCounter ins)
static CompressedMatrixBlock
createConstant(int numRows, int numCols, double value)
Method for constructing a compressed matrix out of an constant input.static CompressedMatrixBlock
genUncompressedCompressedMatrixBlock(MatrixBlock mb)
Generate a CompressedMatrixBlock Object that contains a single uncompressed matrix block column group.static boolean
transposeHeuristics(int nGroups, MatrixBlock mb)
-
-
-
Method Detail
-
compress
public static org.apache.commons.lang3.tuple.Pair<MatrixBlock,CompressionStatistics> compress(MatrixBlock mb)
Default sequential compression with no parallelization- Parameters:
mb
- The matrixBlock to compress- Returns:
- A Pair of a Matrix Block and Compression Statistics.
-
compress
public static org.apache.commons.lang3.tuple.Pair<MatrixBlock,CompressionStatistics> compress(MatrixBlock mb, WTreeRoot root)
-
compress
public static org.apache.commons.lang3.tuple.Pair<MatrixBlock,CompressionStatistics> compress(MatrixBlock mb, CostEstimatorBuilder csb)
-
compress
public static org.apache.commons.lang3.tuple.Pair<MatrixBlock,CompressionStatistics> compress(MatrixBlock mb, InstructionTypeCounter ins)
-
compress
public static org.apache.commons.lang3.tuple.Pair<MatrixBlock,CompressionStatistics> compress(MatrixBlock mb, CompressionSettingsBuilder customSettings)
-
compress
public static org.apache.commons.lang3.tuple.Pair<MatrixBlock,CompressionStatistics> compress(MatrixBlock mb, int k)
-
compress
public static org.apache.commons.lang3.tuple.Pair<MatrixBlock,CompressionStatistics> compress(MatrixBlock mb, int k, WTreeRoot root)
-
compress
public static org.apache.commons.lang3.tuple.Pair<MatrixBlock,CompressionStatistics> compress(MatrixBlock mb, int k, CostEstimatorBuilder csb)
-
compress
public static org.apache.commons.lang3.tuple.Pair<MatrixBlock,CompressionStatistics> compress(MatrixBlock mb, int k, InstructionTypeCounter ins)
-
compress
public static org.apache.commons.lang3.tuple.Pair<MatrixBlock,CompressionStatistics> compress(MatrixBlock mb, ACostEstimate costEstimator)
-
compress
public static org.apache.commons.lang3.tuple.Pair<MatrixBlock,CompressionStatistics> compress(MatrixBlock mb, int k, ACostEstimate costEstimator)
-
compress
public static org.apache.commons.lang3.tuple.Pair<MatrixBlock,CompressionStatistics> compress(MatrixBlock mb, int k, CompressionSettingsBuilder compSettings)
-
compressAsync
public static void compressAsync(ExecutionContext ec, String varName)
-
compressAsync
public static void compressAsync(ExecutionContext ec, String varName, InstructionTypeCounter ins)
-
compress
public static org.apache.commons.lang3.tuple.Pair<MatrixBlock,CompressionStatistics> compress(MatrixBlock mb, int k, CompressionSettingsBuilder compSettings, WTreeRoot root)
The main method for compressing the input matrix.- Parameters:
mb
- The matrix block to compressk
- The number of threads used to execute the compressioncompSettings
- The Compression settings usedroot
- The root instruction compressed, and used for calculating the computation cost of the compression- Returns:
- A pair of an possibly compressed matrix block and compression statistics.
-
compress
public static org.apache.commons.lang3.tuple.Pair<MatrixBlock,CompressionStatistics> compress(MatrixBlock mb, int k, CompressionSettingsBuilder compSettings, CostEstimatorBuilder csb)
The main method for compressing the input matrix.- Parameters:
mb
- The matrix block to compressk
- The number of threads used to execute the compressioncompSettings
- The Compression settings usedcsb
- The cost estimation builder- Returns:
- A pair of an possibly compressed matrix block and compression statistics.
-
compress
public static org.apache.commons.lang3.tuple.Pair<MatrixBlock,CompressionStatistics> compress(MatrixBlock mb, int k, CompressionSettingsBuilder compSettings, ACostEstimate costEstimator)
-
genUncompressedCompressedMatrixBlock
public static CompressedMatrixBlock genUncompressedCompressedMatrixBlock(MatrixBlock mb)
Generate a CompressedMatrixBlock Object that contains a single uncompressed matrix block column group. Note this could be an empty colgroup if the input is empty.- Parameters:
mb
- The matrix block to be contained in the uncompressed matrix block column,- Returns:
- a CompressedMatrixBlock
-
createConstant
public static CompressedMatrixBlock createConstant(int numRows, int numCols, double value)
Method for constructing a compressed matrix out of an constant input. Since the input is a constant value it is trivially compressable, therefore we skip the entire compression planning and directly return a compressed constant matrix- Parameters:
numRows
- The number of Rows in the matrixnumCols
- The number of Columns in the matrixvalue
- The value contained in the matrix- Returns:
- The Compressed Constant matrix.
-
transposeHeuristics
public static boolean transposeHeuristics(int nGroups, MatrixBlock mb)
-
-