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 and Description
    --- | ---
    `static class` | `LibMatrixBincell.BinaryAccessType`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `bincellOp(MatrixBlock m1, MatrixBlock m2, MatrixBlock ret, BinaryOperator op)` matrix-matrix binary operations, MM, MV
    `static void` | `bincellOp(MatrixBlock m1, MatrixBlock ret, ScalarOperator op)` matrix-scalar, scalar-matrix binary operations.
    `static void` | `bincellOpInPlace(MatrixBlock m1ret, MatrixBlock m2, BinaryOperator op)` NOTE: operations in place always require m1 and m2 to be of equal dimensions
    `static LibMatrixBincell.BinaryAccessType` | `getBinaryAccessType(MatrixBlock m1, MatrixBlock m2)`
    `static boolean` | `isSparseSafeDivide(BinaryOperator op, MatrixBlock rhs)`
    `static boolean` | `isValidDimensionsBinary(MatrixBlock m1, MatrixBlock m2)`

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

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

- - ### Method Detail

    - #### bincellOp

          public static void bincellOp(MatrixBlock m1,
                                       MatrixBlock ret,
                                       ScalarOperator op)

      matrix-scalar, scalar-matrix binary operations.
      Parameters:
        `m1` - input matrix
        `ret` - result matrix
        `op` - scalar operator

    - #### bincellOp

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

      matrix-matrix binary operations, MM, MV
      Parameters:
        `m1` - input matrix 1
        `m2` - input matrix 2
        `ret` - result matrix
        `op` - binary operator

    - #### bincellOpInPlace

          public static void bincellOpInPlace(MatrixBlock m1ret,
                                              MatrixBlock m2,
                                              BinaryOperator op)

      NOTE: operations in place always require m1 and m2 to be of equal dimensions
      Parameters:
        `m1ret` - result matrix
        `m2` - matrix block
        `op` - binary operator

    - #### getBinaryAccessType

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

    - #### isValidDimensionsBinary

          public static boolean isValidDimensionsBinary(MatrixBlock m1,
                                                        MatrixBlock m2)

    - #### isSparseSafeDivide

          public static boolean isSparseSafeDivide(BinaryOperator op,
                                                   MatrixBlock rhs)

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