Class ACostEstimate
java.lang.Object
org.apache.sysds.runtime.compress.cost.ACostEstimate
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ComputationCostEstimator,DistinctCostEstimator,HybridCostEstimator,MemoryCostEstimator
A cost estimator interface. It is used to estimate the cost at different stages of compression, and used to compare
to uncompressed.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondoublegetCost(Collection<AColGroup> cgs, int nRows) Get the cost of a collection of column groups.abstract doubleGet the cost of a compressed columnGroup.doubleGet cost of a compressed matrix blockdoubleGet cost of an entire compression planfinal doubleGet cost of a single column group estimate.abstract doublegetCost(MatrixBlock mb) Get the cost of a matrix block.abstract booleanAsk the cost estimator if it is a good idea to try to sparsify a column group.toString()
-
Method Details
-
getCost
Get the cost of a collection of column groups.- Parameters:
cgs- A collection of column groupsnRows- The number of rows in the column group- Returns:
- The summed cost of the groups
-
getCost
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
-
getCost
Get cost of an entire compression plan- Parameters:
i- The compression plan to get the cost of- Returns:
- The cost
-
getCost
Get cost of a compressed matrix block- Parameters:
cmb- The compressed matrix block- Returns:
- The cost
-
getCost
Get the cost of a matrix block.- Parameters:
mb- A MatrixBlock- Returns:
- The cost subject to the internal cost functions
-
getCost
Get the cost of a compressed columnGroup.- Parameters:
cg- A ColumnGroupnRows- The number of rows in the column group- Returns:
- The cost subject to the internal cost functions
-
shouldSparsify
public 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
-
toString
-