org.apache.sysds.runtime.matrix.operators

## Class BinaryOperator

- java.lang.Object
- - org.apache.sysds.runtime.matrix.operators.Operator
  - - org.apache.sysds.runtime.matrix.operators.BinaryOperator

All Implemented Interfaces:
  Serializable

    public class BinaryOperator
    extends Operator
    implements Serializable

See Also:
  Serialized Form

### Field Summary

Fields
`boolean` `commutative`
`ValueFunction` `fn`

### Fields inherited from class org.apache.sysds.runtime.matrix.operators.Operator

`sparseSafe`

### Constructor Summary

Constructors
Constructor and Description
`BinaryOperator(ValueFunction p)`

### Method Summary

All Methods Instance Methods Concrete Methods
`Types.OpOp2` `getBinaryOperatorOpOp2()` Method for getting the hop binary operator type for a given function object.
`int` `getNumThreads()`
`boolean` `isCommutative()`
`void` `setNumThreads(int k)`
`String` `toString()`

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

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

### Field Detail

#### fn

    public final ValueFunction fn

#### commutative

    public final boolean commutative

### Constructor Detail

#### BinaryOperator

    public BinaryOperator(ValueFunction p)

### Method Detail

#### setNumThreads

    public void setNumThreads(int k)

#### getNumThreads

    public int getNumThreads()

#### getBinaryOperatorOpOp2

    public Types.OpOp2 getBinaryOperatorOpOp2()

Method for getting the hop binary operator type for a given function object. This is used in order to use a common code path for consistency between compiler and runtime.

Returns:
  binary operator type for a function object

#### isCommutative

    public boolean isCommutative()

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`