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

# Class LibMatrixBincell

java.lang.Object
org.apache.sysds.runtime.matrix.data.LibMatrixBincell

public class LibMatrixBincell extends Object
Library for binary cellwise operations (incl arithmetic, relational, etc). Currently, we don't have dedicated support for the individual operations but for categories of operations and combinations of dense/sparse and MM/MV. Safe/unsafe refer to sparse-safe and sparse-unsafe operations.

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static enum`
`LibMatrixBincell.BinaryAccessType`

## Method Summary

Modifier and Type
Method
Description
`static MatrixBlock`
`bincellOp(MatrixBlock m1, MatrixBlock m2, MatrixBlock ret, BinaryOperator op)`
`static MatrixBlock`
`bincellOpInPlace(MatrixBlock m1ret, MatrixBlock m2, BinaryOperator op)`
NOTE: operations in place always require m1 and m2 to be of equal dimensions defaults to right side operations, updating the m1 matrix with like: m1ret op m2
`static MatrixBlock`
`bincellOpInPlaceLeft(MatrixBlock m1ret, MatrixBlock m2, BinaryOperator op)`
Left side operations, updating the m1 matrix like: m2 op m1ret
`static MatrixBlock`
`bincellOpInPlaceRight(MatrixBlock m1ret, MatrixBlock m2, BinaryOperator op)`
Right side operations, updating the m1 matrix like: m1ret op m2
`static MatrixBlock`
`bincellOpScalar(MatrixBlock m1, MatrixBlock ret, ScalarOperator op, int k)`
`static LibMatrixBincell.BinaryAccessType`
`getBinaryAccessType(MatrixBlock m1, MatrixBlock m2)`
`static LibMatrixBincell.BinaryAccessType`
`getBinaryAccessTypeExtended(MatrixBlock m1, MatrixBlock m2)`
`static void`
`isValidDimensionsBinary(MatrixBlock m1, MatrixBlock m2)`
`static BinaryOperator`
`replaceOpWithSparseSafeIfApplicable(MatrixBlock m1, MatrixBlock m2, BinaryOperator op)`
`static MatrixBlock`
`uncellOp(MatrixBlock m1, MatrixBlock ret, UnaryOperator op)`

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

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

## Method Details

### uncellOp

public static MatrixBlock uncellOp(MatrixBlock m1, MatrixBlock ret, UnaryOperator op)

### bincellOpScalar

public static MatrixBlock bincellOpScalar(MatrixBlock m1, MatrixBlock ret, ScalarOperator op, int k)

### bincellOp

public static MatrixBlock bincellOp(MatrixBlock m1, MatrixBlock m2, MatrixBlock ret, BinaryOperator op)

### bincellOpInPlace

public static MatrixBlock bincellOpInPlace(MatrixBlock m1ret, MatrixBlock m2, BinaryOperator op)
NOTE: operations in place always require m1 and m2 to be of equal dimensions defaults to right side operations, updating the m1 matrix with like: m1ret op m2

Parameters:
  `m1ret` - result matrix updated in place
  `m2` - matrix block the other matrix to take values from
  `op` - binary operator the operator that is placed in the middle of m1ret and m2
Returns:
  The same pointer to m1ret argument, and the updated result.

### bincellOpInPlaceRight

public static MatrixBlock bincellOpInPlaceRight(MatrixBlock m1ret, MatrixBlock m2, BinaryOperator op)
Right side operations, updating the m1 matrix like: m1ret op m2

Parameters:
  `m1ret` - result matrix updated in place
  `m2` - matrix block the other matrix to take values from
  `op` - binary operator the operator that is placed in the middle of m1ret and m2
Returns:
  The result MatrixBlock (same object pointer to m1ret argument)

### bincellOpInPlaceLeft

public static MatrixBlock bincellOpInPlaceLeft(MatrixBlock m1ret, MatrixBlock m2, BinaryOperator op)
Left side operations, updating the m1 matrix like: m2 op m1ret

Parameters:
  `m1ret` - result matrix updated in place
  `m2` - matrix block the other matrix to take values from
  `op` - binary operator the operator that is placed in the middle of m1ret and m2
Returns:
  The result MatrixBlock (same object pointer to m1ret argument)

### getBinaryAccessType

public static LibMatrixBincell.BinaryAccessType getBinaryAccessType(MatrixBlock m1, MatrixBlock m2)

### getBinaryAccessTypeExtended

public static LibMatrixBincell.BinaryAccessType getBinaryAccessTypeExtended(MatrixBlock m1, MatrixBlock m2)

### isValidDimensionsBinary

public static void isValidDimensionsBinary(MatrixBlock m1, MatrixBlock m2)

### replaceOpWithSparseSafeIfApplicable

public static BinaryOperator replaceOpWithSparseSafeIfApplicable(MatrixBlock m1, MatrixBlock m2, BinaryOperator op)