org.apache.sysds.runtime.compress.estim

## Class CompressedSizeInfoColGroup

- java.lang.Object
- - org.apache.sysds.runtime.compress.estim.CompressedSizeInfoColGroup

    public class CompressedSizeInfoColGroup
    extends Object

Information collected about a specific ColGroup's compression size.

### Constructor Summary

Constructors
Constructor and Description
`CompressedSizeInfoColGroup(int[] columns, EstimationFactors facts, double sparsity)`
`CompressedSizeInfoColGroup(int[] columns, EstimationFactors facts, Set<AColGroup.CompressionType> validCompressionTypes, ABitmap ubm, int sampleSize)`
`CompressedSizeInfoColGroup(int[] columns, int numVals, int numRows)` Join columns without analyzing the content.

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`static CompressedSizeInfoColGroup` `addConstGroup(int[] columns, CompressedSizeInfoColGroup oneSide, Set<AColGroup.CompressionType> validCompressionTypes)` This method adds a column group without having to analyze.
`void` `clearMap()`
`boolean` `containsZeros()`
`Map<AColGroup.CompressionType,Long>` `getAllCompressionSizes()`
`AColGroup.CompressionType` `getBestCompressionType()`
`AColGroup.CompressionType` `getBestCompressionType(CompressionSettings cs)`
`double` `getCardinalityRatio()`
`int[]` `getColumns()`
`long` `getCompressionSize(AColGroup.CompressionType ct)`
`AMapToData` `getMap()`
`long` `getMinSize()`
`double` `getMostCommonFraction()`
`int` `getNumOffs()` Number of offsets, or number of non zero values.
`int` `getNumRows()`
`int` `getNumVals()` Note cardinality is the same as number of distinct values.
`double` `getTupleSparsity()`
`boolean` `isEmpty()`
`String` `toString()`

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

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

### Constructor Detail

#### CompressedSizeInfoColGroup

    public CompressedSizeInfoColGroup(int[] columns,
                                      int numVals,
                                      int numRows)

Join columns without analyzing the content. This only specify the compression ratio if encoded in DDC since this is trivially calculated. The number of tuples contained can be set to the upper theoretical bound of two groups by multiplying the number of distinct tuple of each colGroups with each other. SHOULD NOT BE USED FOR AN ACCURATE ESTIMATE OF SIZE

Parameters:
  `columns` - The columns combined
  `numVals` - The number of distinct value tuples contained
  `numRows` - The number of rows.

#### CompressedSizeInfoColGroup

    public CompressedSizeInfoColGroup(int[] columns,
                                      EstimationFactors facts,
                                      double sparsity)

#### CompressedSizeInfoColGroup

    public CompressedSizeInfoColGroup(int[] columns,
                                      EstimationFactors facts,
                                      Set<AColGroup.CompressionType> validCompressionTypes,
                                      ABitmap ubm,
                                      int sampleSize)

### Method Detail

#### addConstGroup

    public static CompressedSizeInfoColGroup addConstGroup(int[] columns,
                                                           CompressedSizeInfoColGroup oneSide,
                                                           Set<AColGroup.CompressionType> validCompressionTypes)

This method adds a column group without having to analyze. This is because the columns added are constant groups. NOTE THIS IS ONLY VALID IF THE COLUMN ADDED IS EMPTY OR CONSTANT!

Parameters:
  `columns` - The columns of the colgroups together
  `oneSide` - One of the sides, this may contain something, but the other side (not part of the argument) should not.
  `validCompressionTypes` - The List of valid compression techniques to use
Returns:
  A Combined estimate of the column group.

#### getCompressionSize

    public long getCompressionSize(AColGroup.CompressionType ct)

#### getBestCompressionType

    public AColGroup.CompressionType getBestCompressionType(CompressionSettings cs)

#### getBestCompressionType

    public AColGroup.CompressionType getBestCompressionType()

#### getAllCompressionSizes

    public Map<AColGroup.CompressionType,Long> getAllCompressionSizes()

#### getMinSize

    public long getMinSize()

#### getNumVals

    public int getNumVals()

Note cardinality is the same as number of distinct values.

Returns:
  cardinality or number of distinct values.

#### getNumOffs

    public int getNumOffs()

Number of offsets, or number of non zero values.

Returns:
  Number of non zeros or number of values.

#### getColumns

    public int[] getColumns()

#### getNumRows

    public int getNumRows()

#### getCardinalityRatio

    public double getCardinalityRatio()

#### getMostCommonFraction

    public double getMostCommonFraction()

#### getTupleSparsity

    public double getTupleSparsity()

#### getMap

    public AMapToData getMap()

#### containsZeros

    public boolean containsZeros()

#### isEmpty

    public boolean isEmpty()

#### clearMap

    public void clearMap()

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`