Package org.apache.sysds.runtime.matrix.data

# Interface LibMatrixCountDistinct

public interface LibMatrixCountDistinct
This class contains various methods for counting the number of distinct values inside a MatrixBlock

## Field Summary

Fields
Modifier and Type
Field
Description
`static final org.apache.commons.logging.Log`
`LOG`
`static final int`
`minimumSize`
The minimum number NonZero of cells in the input before using approximate techniques for counting number of distinct values.

## Method Summary

Static Methods
Modifier and Type
Method
Description
`static MatrixBlock`
`countDistinctValuesFromSketch(CountDistinctOperator op, CorrMatrixBlock corrBlkIn)`
`static CorrMatrixBlock`
`createSketch(CountDistinctOperator op, MatrixBlock blkIn)`
`static MatrixBlock`
`estimateDistinctValues(MatrixBlock in, CountDistinctOperator op)`
Public method to count the number of distinct values inside a matrix.
`static CorrMatrixBlock`
`unionSketch(CountDistinctOperator op, CorrMatrixBlock corrBlkIn0, CorrMatrixBlock corrBlkIn1)`

## Field Details

### LOG

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

### minimumSize

static final int minimumSize
The minimum number NonZero of cells in the input before using approximate techniques for counting number of distinct values.

See Also:
  - Constant Field Values

## Method Details

### estimateDistinctValues

static MatrixBlock estimateDistinctValues(MatrixBlock in, CountDistinctOperator op)
Public method to count the number of distinct values inside a matrix. Depending on which CountDistinctOperator selected it either gets the absolute number or a estimated value. TODO: If the MatrixBlock type is CompressedMatrix, simply read the values from the ColGroups.

Parameters:
  `in` - the input matrix to count number distinct values in
  `op` - the selected operator to use
Returns:
  A matrix block containing the absolute distinct count for the entire input or along given row/col axis

### countDistinctValuesFromSketch

static MatrixBlock countDistinctValuesFromSketch(CountDistinctOperator op, CorrMatrixBlock corrBlkIn)

### createSketch

static CorrMatrixBlock createSketch(CountDistinctOperator op, MatrixBlock blkIn)

### unionSketch

static CorrMatrixBlock unionSketch(CountDistinctOperator op, CorrMatrixBlock corrBlkIn0, CorrMatrixBlock corrBlkIn1)