Package org.apache.sysds.hops.rewrite

# Class HopRewriteRule

java.lang.Object
org.apache.sysds.hops.rewrite.HopRewriteRule

Direct Known Subclasses:
  `RewriteAlgebraicSimplificationDynamic`, `RewriteAlgebraicSimplificationStatic`, `RewriteBlockSizeAndReblock`, `RewriteCommonSubexpressionElimination`, `RewriteConstantFolding`, `RewriteElementwiseMultChainOptimization`, `RewriteGPUSpecificOps`, `RewriteIndexingVectorization`, `RewriteInjectSparkPReadCheckpointing`, `RewriteMatrixMultChainOptimization`, `RewriteMatrixMultChainOptimizationTranspose`, `RewriteMatrixMultChainWithTransOptimization`, `RewriteNonScalarPrint`, `RewriteQuantizationFusedCompression`, `RewriteRemovePersistentReadWrite`, `RewriteRemoveReadAfterWrite`, `RewriteRemoveUnnecessaryCasts`

public abstract class HopRewriteRule extends Object
Base class for all hop rewrites in order to enable generic application of all rules.

## Constructor Summary

Constructors
Constructor
Description
`HopRewriteRule()`

## Method Summary

Modifier and Type
Method
Description
`abstract Hop`
`rewriteHopDAG(Hop root, ProgramRewriteStatus state)`
Handle a predicate hop DAG with exactly one root.
`abstract ArrayList<Hop>`
`rewriteHopDAGs(ArrayList<Hop> roots, ProgramRewriteStatus state)`
Handle a generic (last-level) hop DAG with multiple roots.

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

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

## Constructor Details

### HopRewriteRule

public HopRewriteRule()

## Method Details

### rewriteHopDAGs

public abstract ArrayList<Hop> rewriteHopDAGs(ArrayList<Hop> roots, ProgramRewriteStatus state)
Handle a generic (last-level) hop DAG with multiple roots.

Parameters:
  `roots` - high-level operator roots
  `state` - program rewrite status
Returns:
  list of high-level operators

### rewriteHopDAG

public abstract Hop rewriteHopDAG(Hop root, ProgramRewriteStatus state)
Handle a predicate hop DAG with exactly one root.

Parameters:
  `root` - high-level operator root
  `state` - program rewrite status
Returns:
  high-level operator