Class ACostEstimate

    • Method Detail

      • getCost

        public 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
      • getCost

        public 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
      • getCost

        public double getCost​(CompressedSizeInfo i)
        Get cost of an entire compression plan
        Parameters:
        i - The compression plan to get the cost of
        Returns:
        The cost
      • getCost

        public double getCost​(CompressedMatrixBlock cmb)
        Get cost of a compressed matrix block
        Parameters:
        cmb - The compressed matrix block
        Returns:
        The cost
      • getCost

        public 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
      • getCost

        public 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
      • 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