Class ComputationCostEstimator
- java.lang.Object
- 
- org.apache.sysds.runtime.compress.cost.ACostEstimate
- 
- org.apache.sysds.runtime.compress.cost.ComputationCostEstimator
 
 
- 
- All Implemented Interfaces:
- Serializable
 
 public class ComputationCostEstimator extends ACostEstimate - See Also:
- Serialized Form
 
- 
- 
Constructor SummaryConstructors Constructor Description ComputationCostEstimator(int scans, int decompressions, int overlappingDecompressions, int leftMultiplications, int rightMultiplications, int compressedMultiplication, int dictOps, boolean isDensifying)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description doublegetCost(int nRows, int nRowsScanned, int nCols, int nVals, double sparsity)Get the cost of a column group.doublegetCost(AColGroup cg, int nRows)Get the cost of a compressed columnGroup.doublegetCost(MatrixBlock mb)Get the cost of a matrix block.booleanisDense()booleanshouldSparsify()Ask the cost estimator if it is a good idea to try to sparsify a column group.StringtoString()- 
Methods inherited from class org.apache.sysds.runtime.compress.cost.ACostEstimategetCost, getCost, getCost, getCost
 
- 
 
- 
- 
- 
Method Detail- 
getCostpublic 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 rows
- nRowsScanned- Number of rows to process in this specific group
- nCols- Number of columns in the column group
- nVals- Number of unique tuples contained in the group
- sparsity- The sparsity of the unique tuples stored
- Returns:
- A cost
 
 - 
isDensepublic boolean isDense() 
 - 
getCostpublic double getCost(MatrixBlock mb) Description copied from class:ACostEstimateGet the cost of a matrix block.- Specified by:
- getCostin class- ACostEstimate
- Parameters:
- mb- A MatrixBlock
- Returns:
- The cost subject to the internal cost functions
 
 - 
getCostpublic double getCost(AColGroup cg, int nRows) Description copied from class:ACostEstimateGet the cost of a compressed columnGroup.- Specified by:
- getCostin class- ACostEstimate
- Parameters:
- cg- A ColumnGroup
- nRows- The number of rows in the column group
- Returns:
- The cost subject to the internal cost functions
 
 - 
shouldSparsifypublic 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 class- ACostEstimate
- Returns:
- true if yes
 
 - 
toStringpublic String toString() - Overrides:
- toStringin class- ACostEstimate
 
 
- 
 
-