Class ComputationCostEstimator
java.lang.Object
org.apache.sysds.runtime.compress.cost.ACostEstimate
org.apache.sysds.runtime.compress.cost.ComputationCostEstimator
- All Implemented Interfaces:
Serializable
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionComputationCostEstimator(int scans, int decompressions, int overlappingDecompressions, int leftMultiplications, int rightMultiplications, int compressedMultiplication, int dictOps, int indexing, boolean isDensifying) -
Method Summary
Modifier and TypeMethodDescriptiondoublegetCost(int nRows, int nRowsScanned, int nCols, int nVals, double sparsity) Get the cost of a column group.doubleGet the cost of a compressed columnGroup.doublegetCost(MatrixBlock mb) Get the cost of a matrix block.booleanisDense()booleanAsk the cost estimator if it is a good idea to try to sparsify a column group.toString()Methods inherited from class org.apache.sysds.runtime.compress.cost.ACostEstimate
getCost, getCost, getCost, getCost
-
Constructor Details
-
ComputationCostEstimator
public ComputationCostEstimator(int scans, int decompressions, int overlappingDecompressions, int leftMultiplications, int rightMultiplications, int compressedMultiplication, int dictOps, int indexing, boolean isDensifying)
-
-
Method Details
-
getCost
public double getCost(int nRows, int nRowsScanned, int nCols, int nVals, double sparsity) Get the cost of a column group.- Parameters:
nRows- The total number of rowsnRowsScanned- Number of rows to process in this specific groupnCols- Number of columns in the column groupnVals- Number of unique tuples contained in the groupsparsity- The sparsity of the unique tuples stored- Returns:
- A cost
-
isDense
public boolean isDense() -
getCost
Description copied from class:ACostEstimateGet the cost of a matrix block.- Specified by:
getCostin classACostEstimate- Parameters:
mb- A MatrixBlock- Returns:
- The cost subject to the internal cost functions
-
getCost
Description copied from class:ACostEstimateGet the cost of a compressed columnGroup.- Specified by:
getCostin classACostEstimate- Parameters:
cg- A ColumnGroupnRows- The number of rows in the column group- Returns:
- The cost subject to the internal cost functions
-
shouldSparsify
public boolean shouldSparsify()Description copied from class:ACostEstimateAsk the cost estimator if it is a good idea to try to sparsify a column group. It is the same as asking if it is a good idea to make FOR on top of the column group.- Specified by:
shouldSparsifyin classACostEstimate- Returns:
- true if yes
-
toString
- Overrides:
toStringin classACostEstimate
-