Package org.apache.sysds.runtime.compress.colgroup.scheme

# Class CompressionScheme

java.lang.Object
org.apache.sysds.runtime.compress.colgroup.scheme.CompressionScheme

public class CompressionScheme extends Object
A Class that contains a full compression scheme that can be applied to MatrixBlocks.

## Constructor Summary

Constructors
Constructor
Description
`CompressionScheme(ICLAScheme[] encodings)`

## Method Summary

Modifier and Type
Method
Description
`CompressedMatrixBlock`
`encode(MatrixBlock mb)`
Encode the given matrix block, it is assumed that the given MatrixBlock already fit the current scheme.
`CompressedMatrixBlock`
`encode(MatrixBlock mb, int k)`
Encode the given matrix block, it is assumed that the given MatrixBlock already fit the current scheme.
`ICLAScheme`
`get(int i)`
Get the encoding in a specific index.
`static CompressionScheme`
`getScheme(CompressedMatrixBlock cmb)`
Extract a compression scheme for the given matrix block
`String`
`toString()`
`CompressionScheme`
`update(MatrixBlock mb)`
Update the encodings contained to also enable compression of the given mb.
`CompressionScheme`
`update(MatrixBlock mb, int k)`
Update the encodings contained to also enable compression of the given mb.
`CompressedMatrixBlock`
`updateAndEncode(MatrixBlock mb)`
`CompressedMatrixBlock`
`updateAndEncode(MatrixBlock mb, int k)`

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

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

## Constructor Details

### CompressionScheme

public CompressionScheme(ICLAScheme[] encodings)

## Method Details

### get

public ICLAScheme get(int i)
Get the encoding in a specific index.

Parameters:
  `i` - the index
Returns:
  The encoding in that index

### encode

public CompressedMatrixBlock encode(MatrixBlock mb)
Encode the given matrix block, it is assumed that the given MatrixBlock already fit the current scheme.

Parameters:
  `mb` - A MatrixBlock given that should fit the scheme
Returns:
  A Compressed instance of the given matrixBlock;

### encode

public CompressedMatrixBlock encode(MatrixBlock mb, int k)
Encode the given matrix block, it is assumed that the given MatrixBlock already fit the current scheme.

Parameters:
  `mb` - A MatrixBlock given that should fit the scheme
  `k` - The parallelization degree
Returns:
  A Compressed instance of the given matrixBlock;

### update

public CompressionScheme update(MatrixBlock mb)
Update the encodings contained to also enable compression of the given mb.

Parameters:
  `mb` - The matrixBlock to enable compression on.
Returns:
  The updated scheme. (It is updated in place)

### update

public CompressionScheme update(MatrixBlock mb, int k)
Update the encodings contained to also enable compression of the given mb.

Parameters:
  `mb` - The matrixBlock to enable compression on.
  `k` - The parallelization degree
Returns:
  The updated scheme. (It is updated in place)

### getScheme

public static CompressionScheme getScheme(CompressedMatrixBlock cmb)
Extract a compression scheme for the given matrix block

Parameters:
  `cmb` - The given compressed matrix block
Returns:
  A Compression scheme that can be applied to new encodings.

### updateAndEncode

public CompressedMatrixBlock updateAndEncode(MatrixBlock mb, int k)

### updateAndEncode

public CompressedMatrixBlock updateAndEncode(MatrixBlock mb)

### toString

public String toString()

Overrides:
  `toString` in class `Object`