Class CompressionScheme


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

      • CompressionScheme

        public CompressionScheme​(ICLAScheme[] encodings)
    • Method Detail

      • 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.