org.apache.sysml.runtime.compress

Class ColGroupOLE

  • All Implemented Interfaces:
    Serializable


    public class ColGroupOLE
    extends ColGroupOffset
    Class to encapsulate information about a column group that is encoded with simple lists of offsets for each set of distinct values.
    See Also:
    Serialized Form
    • Constructor Detail

      • ColGroupOLE

        public ColGroupOLE()
      • ColGroupOLE

        public ColGroupOLE(int[] colIndices,
                           int numRows,
                           UncompressedBitmap ubm)
        Main constructor. Constructs and stores the necessary bitmaps.
        Parameters:
        colIndices - indices (within the block) of the columns included in this column
        numRows - total number of rows in the parent block
        ubm - Uncompressed bitmap representation of the block
      • ColGroupOLE

        public ColGroupOLE(int[] colIndices,
                           int numRows,
                           boolean zeros,
                           double[] values,
                           char[] bitmaps,
                           int[] bitmapOffs)
    • Method Detail

      • getDecodeIterator

        public Iterator<Integer> getDecodeIterator(int k)
        Specified by:
        getDecodeIterator in class ColGroupOffset
        Parameters:
        k - index of a specific compressed bitmap (stored in subclass, index same as ColGroupValue.getValues())
        Returns:
        an object for iterating over the row offsets in this bitmap. Only valid until the next call to this method. May be reused across calls.
      • decompressToBlock

        public void decompressToBlock(MatrixBlock target,
                                      int rl,
                                      int ru)
        Description copied from class: ColGroup
        Decompress the contents of this column group into the specified full matrix block.
        Overrides:
        decompressToBlock in class ColGroupOffset
        Parameters:
        target - a matrix block where the columns covered by this column group have not yet been filled in.
        rl - row lower
        ru - row upper
      • decompressToBlock

        public void decompressToBlock(MatrixBlock target,
                                      int[] colixTargets)
        Description copied from class: ColGroup
        Decompress the contents of this column group into uncompressed packed columns
        Overrides:
        decompressToBlock in class ColGroupOffset
        Parameters:
        target - a dense matrix block. The block must have enough space to hold the contents of this column group.
        colixTargets - array that maps column indices in the original matrix block to columns of target.
      • decompressToBlock

        public void decompressToBlock(MatrixBlock target,
                                      int colpos)
        Description copied from class: ColGroup
        Decompress to block.
        Overrides:
        decompressToBlock in class ColGroupOffset
        Parameters:
        target - dense output vector
        colpos - column to decompress, error if larger or equal numCols
      • scalarOperation

        public ColGroup scalarOperation(org.apache.sysml.runtime.matrix.operators.ScalarOperator op)
                                 throws DMLRuntimeException
        Description copied from class: ColGroup
        Perform the specified scalar operation directly on the compressed column group, without decompressing individual cells if possible.
        Specified by:
        scalarOperation in class ColGroup
        Parameters:
        op - operation to perform
        Returns:
        version of this column group with the operation applied
        Throws:
        DMLRuntimeException - if DMLRuntimeException occurs
      • rightMultByVector

        public void rightMultByVector(MatrixBlock vector,
                                      MatrixBlock result,
                                      int rl,
                                      int ru)
                               throws DMLRuntimeException
        Description copied from class: ColGroup
        Multiply the slice of the matrix that this column group represents by a vector on the right.
        Specified by:
        rightMultByVector in class ColGroup
        Parameters:
        vector - vector to multiply by (tall vector)
        result - accumulator for holding the result
        rl - row lower
        ru - row upper
        Throws:
        DMLRuntimeException - if the internal SystemML code that performs the multiplication experiences an error
      • leftMultByRowVector

        public void leftMultByRowVector(MatrixBlock vector,
                                        MatrixBlock result)
                                 throws DMLRuntimeException
        Description copied from class: ColGroup
        Multiply the slice of the matrix that this column group represents by a row vector on the left (the original column vector is assumed to be transposed already i.e. its size now is 1xn).
        Specified by:
        leftMultByRowVector in class ColGroup
        Parameters:
        vector - row vector
        result - matrix block result
        Throws:
        DMLRuntimeException - if DMLRuntimeException occurs
      • computeSum

        protected final void computeSum(MatrixBlock result,
                                        org.apache.sysml.runtime.functionobjects.KahanFunction kplus)
        Specified by:
        computeSum in class ColGroupOffset
      • computeRowSums

        protected final void computeRowSums(MatrixBlock result,
                                            org.apache.sysml.runtime.functionobjects.KahanFunction kplus,
                                            int rl,
                                            int ru)
        Specified by:
        computeRowSums in class ColGroupOffset
      • computeRowMxx

        protected final void computeRowMxx(MatrixBlock result,
                                           org.apache.sysml.runtime.functionobjects.Builtin builtin,
                                           int rl,
                                           int ru)
        Specified by:
        computeRowMxx in class ColGroupOffset
      • countNonZerosPerRow

        protected void countNonZerosPerRow(int[] rnnz,
                                           int rl,
                                           int ru)
        Description copied from class: ColGroup
        Count the number of non-zeros per row
        Specified by:
        countNonZerosPerRow in class ColGroup
        Parameters:
        rnnz - non-zeros per row
        rl - row lower bound, inclusive
        ru - row upper bound, exclusive

Copyright © 2017 The Apache Software Foundation. All rights reserved.