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

## Class OperationsOnMatrixValues

- java.lang.Object
- - org.apache.sysds.runtime.matrix.data.OperationsOnMatrixValues

    public class OperationsOnMatrixValues
    extends Object

### Constructor Summary

Constructors
`OperationsOnMatrixValues()`

### Method Summary

All Methods Static Methods Concrete Methods
`static void` `incrementalAggregation​(MatrixValue valueAgg, MatrixValue correction, MatrixValue valueAdd, AggregateOperator op, boolean embeddedCorrection)`
`static void` `incrementalAggregation​(MatrixValue valueAgg, MatrixValue correction, MatrixValue valueAdd, AggregateOperator op, boolean embeddedCorrection, boolean deep)`
`static MatrixBlock` `matMult​(MatrixBlock value1, MatrixBlock value2, MatrixBlock valueOut, AggregateBinaryOperator op)`
`static MatrixBlock` `matMult​(MatrixBlock value1, MatrixBlock value2, AggregateBinaryOperator op)`
`static MatrixBlock` `matMult​(MatrixIndexes indexes1, MatrixBlock value1, MatrixIndexes indexes2, MatrixBlock value2, MatrixIndexes indexesOut, MatrixBlock valueOut, AggregateBinaryOperator op)`
`static void` `performAggregateUnary​(MatrixIndexes indexesIn, MatrixValue valueIn, MatrixIndexes indexesOut, MatrixValue valueOut, AggregateUnaryOperator op, int blen)`
`static void` `performMapGroupedAggregate​(Operator op, IndexedMatrixValue inTarget, MatrixBlock groups, int ngroups, int blen, ArrayList<IndexedMatrixValue> outlist)`
`static void` `performShift​(IndexedMatrixValue in, IndexRange ixrange, int blen, long rlen, long clen, ArrayList<IndexedMatrixValue> outlist)`
`static void` `performShift​(Pair<Long,​FrameBlock> in, IndexRange ixrange, int blenLeft, long rlen, long clen, ArrayList<Pair<Long,​FrameBlock>> outlist)`
`static ArrayList<IndexedMatrixValue>` `performSlice​(IndexedMatrixValue in, IndexRange ixrange, int blen)`
`static ArrayList<Pair<Long,​FrameBlock>>` `performSlice​(Pair<Long,​FrameBlock> in, IndexRange ixrange, int blen)` This function will get slice of the input frame block overlapping in overall slice(Range), slice has requested for.
`static List` `performSlice​(IndexRange ixrange, int blen, int iix, int jix, CacheBlock<?> in)` Slice used in broadcasting matrix blocks for spark, since this slice up a given matrix into blocks.
`static ArrayList` `performSlice​(IndexRange ixrange, int blen, int iix, int jix, FrameBlock in)`
`static List` `performSlice​(IndexRange ixrange, int blen, int iix, int jix, MatrixBlock in)`

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

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

### Constructor Detail

#### OperationsOnMatrixValues

    public OperationsOnMatrixValues()

### Method Detail

#### incrementalAggregation

    public static void incrementalAggregation​(MatrixValue valueAgg,
                                              MatrixValue correction,
                                              MatrixValue valueAdd,
                                              AggregateOperator op,
                                              boolean embeddedCorrection)

#### incrementalAggregation

    public static void incrementalAggregation​(MatrixValue valueAgg,
                                              MatrixValue correction,
                                              MatrixValue valueAdd,
                                              AggregateOperator op,
                                              boolean embeddedCorrection,
                                              boolean deep)

#### performAggregateUnary

    public static void performAggregateUnary​(MatrixIndexes indexesIn,
                                             MatrixValue valueIn,
                                             MatrixIndexes indexesOut,
                                             MatrixValue valueOut,
                                             AggregateUnaryOperator op,
                                             int blen)

#### matMult

    public static MatrixBlock matMult​(MatrixIndexes indexes1,
                                      MatrixBlock value1,
                                      MatrixIndexes indexes2,
                                      MatrixBlock value2,
                                      MatrixIndexes indexesOut,
                                      MatrixBlock valueOut,
                                      AggregateBinaryOperator op)

#### matMult

    public static MatrixBlock matMult​(MatrixBlock value1,
                                      MatrixBlock value2,
                                      AggregateBinaryOperator op)

#### matMult

    public static MatrixBlock matMult​(MatrixBlock value1,
                                      MatrixBlock value2,
                                      MatrixBlock valueOut,
                                      AggregateBinaryOperator op)

#### performSlice

    public static List performSlice​(IndexRange ixrange,
                                    int blen,
                                    int iix,
                                    int jix,
                                    CacheBlock<?> in)

Slice used in broadcasting matrix blocks for spark, since this slice up a given matrix into blocks. The slice call here returns a single block inside the idx range specified

Parameters:
  `ixrange` - Index range containing the row lower, row upper, col lower and col upper bounds
  `blen` - The block size specified, this should align with the ranges.
  `iix` - The block row index
  `jix` - The block column index
  `in` - The Cache block to slice out
Returns:
  A List containing pairs of MatrixIndices and CacheBlocks either containing MatrixBlock or FrameBlocks

#### performSlice

    public static List performSlice​(IndexRange ixrange,
                                    int blen,
                                    int iix,
                                    int jix,
                                    MatrixBlock in)

#### performSlice

    public static ArrayList<IndexedMatrixValue> performSlice​(IndexedMatrixValue in,
                                                             IndexRange ixrange,
                                                             int blen)

#### performShift

    public static void performShift​(IndexedMatrixValue in,
                                    IndexRange ixrange,
                                    int blen,
                                    long rlen,
                                    long clen,
                                    ArrayList<IndexedMatrixValue> outlist)

#### performMapGroupedAggregate

    public static void performMapGroupedAggregate​(Operator op,
                                                  IndexedMatrixValue inTarget,
                                                  MatrixBlock groups,
                                                  int ngroups,
                                                  int blen,
                                                  ArrayList<IndexedMatrixValue> outlist)

#### performSlice

    public static ArrayList performSlice​(IndexRange ixrange,
                                         int blen,
                                         int iix,
                                         int jix,
                                         FrameBlock in)

#### performSlice

    public static ArrayList<Pair<Long,​FrameBlock>> performSlice​(Pair<Long,​FrameBlock> in,
                                                                      IndexRange ixrange,
                                                                      int blen)

This function will get slice of the input frame block overlapping in overall slice(Range), slice has requested for.

Parameters:
  `in` - A Pair of row index to assign the sliced block and input frame block to slice.
  `ixrange` - index range
  `blen` - block length
Returns:
  Returns an ArrayList containing pairs of long ids and FrameBlocks

#### performShift

    public static void performShift​(Pair<Long,​FrameBlock> in,
                                    IndexRange ixrange,
                                    int blenLeft,
                                    long rlen,
                                    long clen,
                                    ArrayList<Pair<Long,​FrameBlock>> outlist)