Class DistinctCostEstimator
- java.lang.Object
-
- org.apache.sysds.runtime.compress.cost.ACostEstimate
-
- org.apache.sysds.runtime.compress.cost.DistinctCostEstimator
-
- All Implemented Interfaces:
Serializable
public class DistinctCostEstimator extends ACostEstimate
A Cost based estimator that based the compression and co-coding cost on the number of distinct elements in the column groups. The base cost of the uncompressed representation is the number of cells in the matrix that has a value. Aka nonzero values.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DistinctCostEstimator(int nRows, CompressionSettings cs, double sparsity)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
getCost(AColGroup cg, int nRows)
Get the cost of a compressed columnGroup.double
getCost(MatrixBlock mb)
Get the cost of a matrix block.boolean
shouldSparsify()
Ask the cost estimator if it is a good idea to try to sparsify a column group.
-
-
-
Constructor Detail
-
DistinctCostEstimator
public DistinctCostEstimator(int nRows, CompressionSettings cs, double sparsity)
-
-
Method Detail
-
getCost
public double getCost(MatrixBlock mb)
Description copied from class:ACostEstimate
Get the cost of a matrix block.- Specified by:
getCost
in classACostEstimate
- Parameters:
mb
- A MatrixBlock- Returns:
- The cost subject to the internal cost functions
-
getCost
public double getCost(AColGroup cg, int nRows)
Description copied from class:ACostEstimate
Get the cost of a compressed columnGroup.- Specified by:
getCost
in 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:ACostEstimate
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.- Specified by:
shouldSparsify
in classACostEstimate
- Returns:
- true if yes
-
-