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

## Interface MatrixSketch<T>

- All Known Implementing Classes:
    `KMVSketch`

      public interface MatrixSketch<T>

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `CorrMatrixBlock` | `create​(MatrixBlock blkIn)` | Create a initial sketch of a given block.
    `MatrixBlock` | `getMatrixValue​(CorrMatrixBlock blkIn)` | Obtain matrix distinct count value from estimation Used for estimating distinct in rows or columns.
    `T` | `getScalarValue​(MatrixBlock blkIn)` | Get scalar distinct count from a input matrix block.
    `CorrMatrixBlock` | `intersection​(CorrMatrixBlock arg0, CorrMatrixBlock arg1)` | Intersect two sketches
    `CorrMatrixBlock` | `union​(CorrMatrixBlock arg0, CorrMatrixBlock arg1)` | Union two sketches together to from a combined sketch.

- - ### Method Detail

    - #### getScalarValue

          T getScalarValue​(MatrixBlock blkIn)

      Get scalar distinct count from a input matrix block.
      Parameters:
        `blkIn` - A input block to estimate the number of distinct values in
      Returns:
        The distinct count estimate

    - #### getMatrixValue

          MatrixBlock getMatrixValue​(CorrMatrixBlock blkIn)

      Obtain matrix distinct count value from estimation Used for estimating distinct in rows or columns.
      Parameters:
        `blkIn` - The sketch block to extract the count from
      Returns:
        The result matrix block

    - #### create

          CorrMatrixBlock create​(MatrixBlock blkIn)

      Create a initial sketch of a given block.
      Parameters:
        `blkIn` - A block to process
      Returns:
        A sketch

    - #### union

          CorrMatrixBlock union​(CorrMatrixBlock arg0,
                                CorrMatrixBlock arg1)

      Union two sketches together to from a combined sketch.
      Parameters:
        `arg0` - Sketch one
        `arg1` - Sketch two
      Returns:
        The combined sketch

    - #### intersection

          CorrMatrixBlock intersection​(CorrMatrixBlock arg0,
                                       CorrMatrixBlock arg1)

      Intersect two sketches
      Parameters:
        `arg0` - Sketch one
        `arg1` - Sketch two
      Returns:
        The intersected sketch