org.apache.sysml.runtime.matrix.data

Class LibMatrixBincell



  • public class LibMatrixBincell
    extends Object
    MB: 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. TODO: custom operator implementations in order to turn unnecessarily sparse-unsafe operations into sparse safe (e.g., relational operations)
    • Method Detail

      • bincellOp

        public static void bincellOp(MatrixBlock m1,
                                     MatrixBlock ret,
                                     org.apache.sysml.runtime.matrix.operators.ScalarOperator op)
                              throws DMLRuntimeException
        matrix-scalar, scalar-matrix binary operations.
        Parameters:
        m1 - input matrix
        ret - result matrix
        op - scalar operator
        Throws:
        DMLRuntimeException - if DMLRuntimeException occurs
      • bincellOp

        public static void bincellOp(MatrixBlock m1,
                                     MatrixBlock m2,
                                     MatrixBlock ret,
                                     org.apache.sysml.runtime.matrix.operators.BinaryOperator op)
                              throws DMLRuntimeException
        matrix-matrix binary operations, MM, MV
        Parameters:
        m1 - input matrix 1
        m2 - input matrix 2
        ret - result matrix
        op - binary operator
        Throws:
        DMLRuntimeException - if DMLRuntimeException occurs
      • bincellOpInPlace

        public static void bincellOpInPlace(MatrixBlock m1ret,
                                            MatrixBlock m2,
                                            org.apache.sysml.runtime.matrix.operators.BinaryOperator op)
                                     throws DMLRuntimeException
        NOTE: operations in place always require m1 and m2 to be of equal dimensions
        Parameters:
        m1ret - result matrix
        m2 - matrix block
        op - binary operator
        Throws:
        DMLRuntimeException - if DMLRuntimeException occurs
      • isSparseSafeDivide

        public static boolean isSparseSafeDivide(org.apache.sysml.runtime.matrix.operators.BinaryOperator op,
                                                 MatrixBlock rhs)

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