Class ACostEstimate
- java.lang.Object
- 
- org.apache.sysds.runtime.compress.cost.ACostEstimate
 
- 
- All Implemented Interfaces:
- Serializable
 - Direct Known Subclasses:
- ComputationCostEstimator,- DistinctCostEstimator,- HybridCostEstimator,- MemoryCostEstimator
 
 public abstract class ACostEstimate extends Object implements Serializable A cost estimator interface. It is used to estimate the cost at different stages of compression, and used to compare to uncompressed.- See Also:
- Serialized Form
 
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description doublegetCost(Collection<AColGroup> cgs, int nRows)Get the cost of a collection of column groups.abstract doublegetCost(AColGroup cg, int nRows)Get the cost of a compressed columnGroup.doublegetCost(CompressedMatrixBlock cmb)Get cost of a compressed matrix blockdoublegetCost(CompressedSizeInfo i)Get cost of an entire compression plandoublegetCost(CompressedSizeInfoColGroup g)Get cost of a single column group estimate.abstract doublegetCost(MatrixBlock mb)Get the cost of a matrix block.abstract booleanshouldSparsify()Ask the cost estimator if it is a good idea to try to sparsify a column group.StringtoString()
 
- 
- 
- 
Method Detail- 
getCostpublic double getCost(Collection<AColGroup> cgs, int nRows) Get the cost of a collection of column groups.- Parameters:
- cgs- A collection of column groups
- nRows- The number of rows in the column group
- Returns:
- The summed cost of the groups
 
 - 
getCostpublic final double getCost(CompressedSizeInfoColGroup g) Get cost of a single column group estimate. If the input is null the cost is positive infinity indicating that it is impossible to compress the null case. If the instruction does not care about the inter column group cost, such as in memory cost or in computation cost of right or left matrix multiplication we simply estimate the cost of individual column groups.- Parameters:
- g- Column group to estimate the cost of
- Returns:
- The Cost of this column group
 
 - 
getCostpublic double getCost(CompressedSizeInfo i) Get cost of an entire compression plan- Parameters:
- i- The compression plan to get the cost of
- Returns:
- The cost
 
 - 
getCostpublic double getCost(CompressedMatrixBlock cmb) Get cost of a compressed matrix block- Parameters:
- cmb- The compressed matrix block
- Returns:
- The cost
 
 - 
getCostpublic abstract double getCost(MatrixBlock mb) Get the cost of a matrix block.- Parameters:
- mb- A MatrixBlock
- Returns:
- The cost subject to the internal cost functions
 
 - 
getCostpublic abstract double getCost(AColGroup cg, int nRows) Get the cost of a compressed columnGroup.- Parameters:
- cg- A ColumnGroup
- nRows- The number of rows in the column group
- Returns:
- The cost subject to the internal cost functions
 
 - 
shouldSparsifypublic abstract boolean shouldSparsify() Ask 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.- Returns:
- true if yes
 
 
- 
 
-