org.apache.sysds.runtime.compress.cost

## Class HybridCostEstimator

- java.lang.Object
- - org.apache.sysds.runtime.compress.cost.HybridCostEstimator

All Implemented Interfaces:
  Serializable, ICostEstimate

    public class HybridCostEstimator
    extends Object
    implements ICostEstimate

See Also:
  Serialized Form

### Field Summary

### Fields inherited from interface org.apache.sysds.runtime.compress.cost.ICostEstimate

`LOG, serialVersionUID`

### Method Summary

All Methods Instance Methods Concrete Methods
`double` `getCostOfColumnGroup(CompressedSizeInfoColGroup g)` 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.
`double` `getUncompressedCost(CompressedSizeInfoColGroup g)` Calculate the cost of execution if uncompressed.
`boolean` `shouldAnalyze(CompressedSizeInfoColGroup g1, CompressedSizeInfoColGroup g2)` Decide if the column groups should be analysed, or the worst case join should be expected.

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Method Detail

#### getUncompressedCost

    public double getUncompressedCost(CompressedSizeInfoColGroup g)

Description copied from interface: `ICostEstimate`
Calculate the cost of execution if uncompressed. This is used as an optimization goal to at least achieve, since if the uncompressed cost of calculation is lower than in compressed space we don't want to compress.

Specified by:
  `getUncompressedCost` in interface `ICostEstimate`
Parameters:
  `g` - A potential column group to compare to.
Returns:
  The uncompressed cost.

#### getCostOfColumnGroup

    public double getCostOfColumnGroup(CompressedSizeInfoColGroup g)

Description copied from interface: `ICostEstimate`
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.

Specified by:
  `getCostOfColumnGroup` in interface `ICostEstimate`
Parameters:
  `g` - Column group to estimate the cost of
Returns:
  The Cost of this column group

#### shouldAnalyze

    public boolean shouldAnalyze(CompressedSizeInfoColGroup g1,
                                 CompressedSizeInfoColGroup g2)

Description copied from interface: `ICostEstimate`
Decide if the column groups should be analysed, or the worst case join should be expected. This is use full if the column groups are very small and the in practice difference between joining or not is small. Or in the other case where there is some obvious reason why these two groups does not fit together.

Specified by:
  `shouldAnalyze` in interface `ICostEstimate`
Parameters:
  `g1` - Group 1
  `g2` - Group 2
Returns:
  If the joining should be analyzed.