org.apache.sysds.runtime.privacy.propagation

## Class MatrixMultiplicationPropagator

- java.lang.Object
- - org.apache.sysds.runtime.privacy.propagation.MatrixMultiplicationPropagator

All Implemented Interfaces:
  Propagator

Direct Known Subclasses:
  MatrixMultiplicationPropagatorNaive, MatrixMultiplicationPropagatorPrivateFirst, MatrixMultiplicationPropagatorPrivateFirstOptimized

    public abstract class MatrixMultiplicationPropagator
    extends Object
    implements Propagator

Used for propagating constraints in a matrix multiplication.

### Constructor Summary

Constructors
Constructor and Description
`MatrixMultiplicationPropagator()` Constructor for empty instance.
`MatrixMultiplicationPropagator(MatrixBlock input1, PrivacyConstraint privacyConstraint1, MatrixBlock input2, PrivacyConstraint privacyConstraint2)` Constructs the propagator and initializes the fields used for propagation.

### Method Summary

All Methods Instance Methods Concrete Methods
`OperatorType[]` `getOperatorTypesCol()` Gets the operator types of all columns of the right-hand input in the matrix multiplication.
`OperatorType[]` `getOperatorTypesRow()` Gets the operator types of all rows of the left-hand input in the matrix multiplication.
`PrivacyConstraint` `propagate()` Activates the propagation and returns the output privacy constraint.
`void` `setFields(MatrixBlock input1, PrivacyConstraint privacyConstraint1, MatrixBlock input2, PrivacyConstraint privacyConstraint2)` Sets all fields of propagator.

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

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

### Constructor Detail

#### MatrixMultiplicationPropagator

    public MatrixMultiplicationPropagator()

Constructor for empty instance. The fields can later be set with the setFields method.

#### MatrixMultiplicationPropagator

    public MatrixMultiplicationPropagator(MatrixBlock input1,
                                          PrivacyConstraint privacyConstraint1,
                                          MatrixBlock input2,
                                          PrivacyConstraint privacyConstraint2)

Constructs the propagator and initializes the fields used for propagation.

Parameters:
  `input1` - left-hand input in matrix multiplication.
  `privacyConstraint1` - privacy constraint of left-hand input in matrix multiplication
  `input2` - right-hand input in matrix multiplication
  `privacyConstraint2` - privacy constraint of right-hand input in matrix multiplication

### Method Detail

#### setFields

    public void setFields(MatrixBlock input1,
                          PrivacyConstraint privacyConstraint1,
                          MatrixBlock input2,
                          PrivacyConstraint privacyConstraint2)

Sets all fields of propagator.

Parameters:
  `input1` - left-hand input in matrix multiplication.
  `privacyConstraint1` - privacy constraint of left-hand input in matrix multiplication
  `input2` - right-hand input in matrix multiplication
  `privacyConstraint2` - privacy constraint of right-hand input in matrix multiplication

#### propagate

    public PrivacyConstraint propagate()

Description copied from interface: `Propagator`
Activates the propagation and returns the output privacy constraint.

Specified by:
  `propagate` in interface `Propagator`
Returns:
  output privacy constraint.

#### getOperatorTypesRow

    public OperatorType[] getOperatorTypesRow()

Gets the operator types of all rows of the left-hand input in the matrix multiplication. An operator type defines if the row will result in an aggregation or not.

Returns:
  array of operator types representing the rows of the left-hand input in the matrix multiplication

#### getOperatorTypesCol

    public OperatorType[] getOperatorTypesCol()

Gets the operator types of all columns of the right-hand input in the matrix multiplication. An operator type defines if the column will result in an aggregation or not.

Returns:
  array of operator types representing the columns of the right-hand input in the matrix multiplication.