Class MatrixValue

  • All Implemented Interfaces:
    Comparable, org.apache.hadoop.io.Writable, org.apache.hadoop.io.WritableComparable
    Direct Known Subclasses:
    CM_N_COVCell, MatrixBlock, MatrixCell

    public abstract class MatrixValue
    extends Object
    implements org.apache.hadoop.io.WritableComparable
    • Constructor Detail

      • MatrixValue

        public MatrixValue()
      • MatrixValue

        public MatrixValue​(MatrixValue that)
    • Method Detail

      • getNumRows

        public abstract int getNumRows()
      • getNumColumns

        public abstract int getNumColumns()
      • getNonZeros

        public abstract long getNonZeros()
      • setValue

        public abstract void setValue​(int r,
                                      int c,
                                      double v)
      • getValue

        public abstract double getValue​(int r,
                                        int c)
      • isInSparseFormat

        public abstract boolean isInSparseFormat()
      • isEmpty

        public abstract boolean isEmpty()
      • reset

        public abstract void reset()
      • reset

        public abstract void reset​(int rl,
                                   int cl)
      • reset

        public abstract void reset​(int rl,
                                   int cl,
                                   boolean sp)
      • reset

        public abstract void reset​(int rl,
                                   int cl,
                                   boolean sp,
                                   long nnzs)
      • reset

        public abstract void reset​(int rl,
                                   int cl,
                                   double v)
      • copy

        public abstract void copy​(MatrixValue that)
        Copy that MatrixValue into this MatrixValue. If the MatrixValue is a MatrixBlock evaluate the sparsity of the original matrix, and copy into either a sparse or a dense matrix.
        Parameters:
        that - object to copy the values into.
      • copy

        public abstract void copy​(MatrixValue that,
                                  boolean sp)
        Copy that MatrixValue into this MatrixValue. But select sparse destination block depending on boolean parameter.
        Parameters:
        that - object to copy the values into.
        sp - boolean specifying if output should be forced sparse or dense. (only applicable if the 'that' is a MatrixBlock)
      • ctableOperations

        public abstract void ctableOperations​(Operator op,
                                              double scalar_that,
                                              double scalar_that2,
                                              CTableMap resultMap,
                                              MatrixBlock resultBlock)
      • slice

        public abstract void slice​(ArrayList<IndexedMatrixValue> outlist,
                                   IndexRange range,
                                   int rowCut,
                                   int colCut,
                                   int blen,
                                   int boundaryRlen,
                                   int boundaryClen)
        Slice out up to 4 matrixBlocks that are separated by the row and col Cuts. This is used in the context of spark execution to distributed sliced out matrix blocks of correct block size.
        Parameters:
        outlist - The output matrix blocks that is extracted from the matrix
        range - An index range containing overlapping information.
        rowCut - The row to cut and split the matrix.
        colCut - The column to cut ans split the matrix.
        blen - The Block size of the output matrices.
        boundaryRlen - The row length of the edge case matrix block, used for the final blocks that does not have enough rows to construct a full block.
        boundaryClen - The col length of the edge case matrix block, used for the final blocks that does not have enough cols to construct a full block.
      • replaceOperations

        public abstract MatrixValue replaceOperations​(MatrixValue result,
                                                      double pattern,
                                                      double replacement)