Package org.apache.sysds.runtime.controlprogram.parfor.opt

# Class Optimizer

java.lang.Object
org.apache.sysds.runtime.controlprogram.parfor.opt.Optimizer

Direct Known Subclasses:
  `OptimizerRuleBased`

public abstract class Optimizer extends Object
Generic optimizer super class that defines the interface of all implemented optimizers. Furthermore it implements basic primitives, used by all optimizers such as the enumeration of plan alternatives and specific rewrites. Optimization objective: \phi: \min T(prog) | k \leq ck \wedge m(prog) \leq cm with T(p)=max_(1\leq i\leq k)(T(prog_i).

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static enum`
`Optimizer.CostModelType`

## Method Summary

Modifier and Type
Method
Description
`abstract Optimizer.CostModelType`
`getCostModelType()`
`long`
`getNumEvaluatedPlans()`
`long`
`getNumTotalPlans()`
`abstract ParForProgramBlock.POptMode`
`getOptMode()`
`abstract boolean`
`optimize(ParForStatementBlock sb, ParForProgramBlock pb, OptTree plan, CostEstimator est, int numRuns, ExecutionContext ec)`
Optimize the parfor statement block

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

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

## Method Details

### optimize

public abstract boolean optimize(ParForStatementBlock sb, ParForProgramBlock pb, OptTree plan, CostEstimator est, int numRuns, ExecutionContext ec)
Optimize the parfor statement block

Parameters:
  `sb` - parfor statement block
  `pb` - parfor program block
  `plan` - complete plan of a top-level parfor
  `est` - cost estimator
  `numRuns` - Number of runs
  `ec` - execution context
Returns:
  true if plan changed, false otherwise

### getCostModelType

public abstract Optimizer.CostModelType getCostModelType()

### getOptMode

public abstract ParForProgramBlock.POptMode getOptMode()

### getNumTotalPlans

public long getNumTotalPlans()

### getNumEvaluatedPlans

public long getNumEvaluatedPlans()