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

# Interface IEncode

All Known Implementing Classes:
  `AEncode`, `ConstEncoding`, `DenseEncoding`, `EmptyEncoding`, `SparseEncoding`

public interface IEncode
This interface covers an intermediate encoding for the samples to improve the efficiency of the joining of sample column groups.

## Field Summary

Fields
Modifier and Type
Field
Description
`static final org.apache.commons.logging.Log`
`LOG`

## Method Summary

Modifier and Type
Method
Description
`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,HashMapLongInt>`
`combineWithMap(IEncode e)`
Combine two encodings without resizing the output.
`boolean`
`equals(Object e)`
`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.
`int`
`getUnique()`
Get the number of unique values in this encoding
`boolean`
`isDense()`
Signify if the counts are including zero or without zero.

## Field Details

### LOG

static final org.apache.commons.logging.Log LOG

## Method Details

### combine

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.

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

### combineWithMap

org.apache.commons.lang3.tuple.Pair<IEncode,HashMapLongInt> combineWithMap(IEncode e)
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.

NOTE: Require both encodings to contain the correct metadata for number of unique values.

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

### getUnique

int getUnique()
Get the number of unique values in this encoding

Returns:
  The number of unique values.

### extractFacts

EstimationFactors extractFacts(int nRows, double tupleSparsity, double matrixSparsity, CompressionSettings cs)
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

### isDense

boolean isDense()
Signify if the counts are including zero or without zero.

Returns:
  is dense

### equals

boolean equals(Object e)

Overrides:
  `equals` in class `Object`

### equals

boolean equals(IEncode e)
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