Package org.apache.sysds.runtime.compress.estim.encoding

## Class DenseEncoding

- java.lang.Object
- - org.apache.sysds.runtime.compress.estim.encoding.AEncode
  - - org.apache.sysds.runtime.compress.estim.encoding.DenseEncoding

All Implemented Interfaces:
  `IEncode`

    public class DenseEncoding
    extends AEncode

An Encoding that contains a value on each row of the input.

### Field Summary

### Fields inherited from interface org.apache.sysds.runtime.compress.estim.encoding.IEncode

`LOG`

### Constructor Summary

Constructors
`DenseEncoding​(AMapToData map)`

### Method Summary

All Methods Instance Methods Concrete Methods
`IEncode` `combine​(IEncode e)` Combine two encodings, note it should be guaranteed by the caller that the number of unique multiplied does not overflow Integer.
`org.apache.commons.lang3.tuple.Pair<IEncode,​Map<Integer,​Integer>>` `combineWithMap​(IEncode e)` Combine two encodings without resizing the output.
`boolean` `equals​(IEncode e)` Indicate if the given encoding is equivalent to this encoding
`EstimationFactors` `extractFacts​(int nRows, double tupleSparsity, double matrixSparsity, CompressionSettings cs)` Extract the compression facts for this column group.
`AMapToData` `getMap()`
`int` `getUnique()` Get the number of unique values in this encoding
`boolean` `isDense()` Signify if the counts are including zero or without zero.
`String` `toString()`

### Methods inherited from class org.apache.sysds.runtime.compress.estim.encoding.AEncode

`equals`

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

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

### Constructor Detail

#### DenseEncoding

    public DenseEncoding​(AMapToData map)

### Method Detail

#### combine

    public IEncode combine​(IEncode e)

Description copied from interface: `IEncode`
Combine two encodings, note it should be guaranteed by the caller that the number of unique multiplied does not overflow Integer.

Parameters:
  `e` - The other side to combine with
Returns:
  The combined encoding

#### combineWithMap

    public org.apache.commons.lang3.tuple.Pair<IEncode,​Map<Integer,​Integer>> combineWithMap​(IEncode e)

Description copied from interface: `IEncode`
Combine two encodings without resizing the output. meaning the mapping of the indexes should be consistent with left hand side Dictionary indexes and right hand side indexes.

Parameters:
  `e` - The other side to combine with
Returns:
  The combined encoding

#### getUnique

    public int getUnique()

Description copied from interface: `IEncode`
Get the number of unique values in this encoding

Returns:
  The number of unique values.

#### extractFacts

    public EstimationFactors extractFacts​(int nRows,
                                          double tupleSparsity,
                                          double matrixSparsity,
                                          CompressionSettings cs)

Description copied from interface: `IEncode`
Extract the compression facts for this column group.

Parameters:
  `nRows` - The total number of rows
  `tupleSparsity` - The Sparsity of the unique tuples
  `matrixSparsity` - The matrix sparsity
  `cs` - The compression settings
Returns:
  A EstimationFactors object

#### getMap

    public AMapToData getMap()

#### isDense

    public boolean isDense()

Description copied from interface: `IEncode`
Signify if the counts are including zero or without zero.

Returns:
  is dense

#### equals

    public boolean equals​(IEncode e)

Description copied from interface: `IEncode`
Indicate if the given encoding is equivalent to this encoding

Parameters:
  `e` - The other encoding to be compared with this
Returns:
  If the encoding is equivalent

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`