Package org.apache.sysds.runtime.controlprogram

# Class FunctionProgramBlock

java.lang.Object
org.apache.sysds.runtime.controlprogram.ProgramBlock
org.apache.sysds.runtime.controlprogram.FunctionProgramBlock

All Implemented Interfaces:
  `Types.FunctionBlock`, `ParseInfo`

public class FunctionProgramBlock extends ProgramBlock implements Types.FunctionBlock

## Field Summary

Fields
Modifier and Type
Field
Description
`String`
`_functionName`
`String`
`_namespace`

### Fields inherited from class org.apache.sysds.runtime.controlprogram.ProgramBlock

`_beginColumn, _beginLine, _endColumn, _endLine, _filename, _text, CHECK_MATRIX_PROPERTIES, PRED_VAR`

## Constructor Summary

Constructors
Constructor
Description
`FunctionProgramBlock(Program prog, List<DataIdentifier> inputParams, List<DataIdentifier> outputParams)`

## Method Summary

Modifier and Type
Method
Description
`void`
`addProgramBlock(ProgramBlock childBlock)`
`Types.FunctionBlock`
`cloneFunctionBlock()`
`void`
`execute(ExecutionContext ec)`
Executes this program block (incl recompilation if required).
`ArrayList<ProgramBlock>`
`getChildBlocks()`
Get the list of child program blocks if nested; otherwise this method returns null.
`DataIdentifier`
`getInputParam(String name)`
`List<String>`
`getInputParamNames()`
`ArrayList<DataIdentifier>`
`getInputParams()`
`List<String>`
`getOutputParamNames()`
`ArrayList<DataIdentifier>`
`getOutputParams()`
`boolean`
`isNested()`
Indicates if the program block is nested, i.e., if it contains other program blocks (e.g., loops).
`boolean`
`isNondeterministic()`
`boolean`
`isRecompileOnce()`
`String`
`printBlockErrorLocation()`
`void`
`setChildBlocks(ArrayList<ProgramBlock> pbs)`
`void`
`setNondeterministic(boolean flag)`
`void`
`setRecompileOnce(boolean flag)`

### Methods inherited from class org.apache.sysds.runtime.controlprogram.ProgramBlock

`executePredicate, getBeginColumn, getBeginLine, getEndColumn, getEndLine, getExitInstruction, getFilename, getProgram, getStatementBlock, getText, getThreadID, hasThreadID, isThreadID, setBeginColumn, setBeginLine, setEndColumn, setEndLine, setExitInstruction, setFilename, setParseInfo, setStatementBlock, setText, setThreadID`

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

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

## Field Details

### _functionName

public String _functionName

### _namespace

public String _namespace

## Constructor Details

### FunctionProgramBlock

public FunctionProgramBlock(Program prog, List<DataIdentifier> inputParams, List<DataIdentifier> outputParams)

## Method Details

### getInputParam

public DataIdentifier getInputParam(String name)

### getInputParamNames

public List<String> getInputParamNames()

### getOutputParamNames

public List<String> getOutputParamNames()

### getInputParams

public ArrayList<DataIdentifier> getInputParams()

### getOutputParams

public ArrayList<DataIdentifier> getOutputParams()

### addProgramBlock

public void addProgramBlock(ProgramBlock childBlock)

### setChildBlocks

public void setChildBlocks(ArrayList<ProgramBlock> pbs)

### getChildBlocks

public ArrayList<ProgramBlock> getChildBlocks()
Description copied from class: `ProgramBlock`
Get the list of child program blocks if nested; otherwise this method returns null.

Specified by:
  `getChildBlocks` in class `ProgramBlock`
Returns:
  list of program blocks

### isNested

public boolean isNested()
Description copied from class: `ProgramBlock`
Indicates if the program block is nested, i.e., if it contains other program blocks (e.g., loops).

Specified by:
  `isNested` in class `ProgramBlock`
Returns:
  true if nested

### execute

public void execute(ExecutionContext ec)
Description copied from class: `ProgramBlock`
Executes this program block (incl recompilation if required).

Specified by:
  `execute` in class `ProgramBlock`
Parameters:
  `ec` - execution context

### setRecompileOnce

public void setRecompileOnce(boolean flag)

### isRecompileOnce

public boolean isRecompileOnce()

### setNondeterministic

public void setNondeterministic(boolean flag)

### isNondeterministic

public boolean isNondeterministic()

### cloneFunctionBlock

public Types.FunctionBlock cloneFunctionBlock()

Specified by:
  `cloneFunctionBlock` in interface `Types.FunctionBlock`

### printBlockErrorLocation

public String printBlockErrorLocation()

Overrides:
  `printBlockErrorLocation` in class `ProgramBlock`