Package org.apache.sysds.parser
Class StatementBlock
- java.lang.Object
- 
- org.apache.sysds.parser.LiveVariableAnalysis
- 
- org.apache.sysds.parser.StatementBlock
 
 
- 
- All Implemented Interfaces:
- ParseInfo
 - Direct Known Subclasses:
- ForStatementBlock,- FunctionStatementBlock,- IfStatementBlock,- WhileStatementBlock
 
 public class StatementBlock extends LiveVariableAnalysis implements ParseInfo 
- 
- 
Field SummaryFields Modifier and Type Field Description static doubleDEFAULT_LOOP_REPETITIONS
 - 
Constructor SummaryConstructors Constructor Description StatementBlock()StatementBlock(StatementBlock sb)
 - 
Method Summary- 
Methods inherited from class org.apache.sysds.parser.LiveVariableAnalysisgetGen, getKill, getWarn, liveIn, liveOut, setGen, setKill, setLiveIn, setLiveOut, setReadVariables, setUpdatedVariables, updateLiveVariablesOut, variablesRead, variablesUpdated
 
- 
 
- 
- 
- 
Field Detail- 
DEFAULT_LOOP_REPETITIONSpublic static final double DEFAULT_LOOP_REPETITIONS - See Also:
- Constant Field Values
 
 
- 
 - 
Constructor Detail- 
StatementBlockpublic StatementBlock() 
 - 
StatementBlockpublic StatementBlock(StatementBlock sb) 
 
- 
 - 
Method Detail- 
setDMLProgpublic void setDMLProg(DMLProgram dmlProg) 
 - 
getDMLProgpublic DMLProgram getDMLProg() 
 - 
getSBIDpublic long getSBID() 
 - 
getNamepublic String getName() 
 - 
addStatementpublic void addStatement(Statement s) 
 - 
addStatementBlockpublic void addStatementBlock(StatementBlock s) 
 - 
getNumStatementspublic int getNumStatements() 
 - 
getStatementpublic Statement getStatement(int i) 
 - 
mergeablepublic boolean mergeable() 
 - 
setSplitDagpublic void setSplitDag(boolean flag) 
 - 
isSplitDagpublic boolean isSplitDag() 
 - 
isMergeableFunctionCallBlockpublic boolean isMergeableFunctionCallBlock(DMLProgram dmlProg) 
 - 
isRewritableFunctionCallpublic boolean isRewritableFunctionCall(Statement stmt, DMLProgram dmlProg) 
 - 
mergeFunctionCallspublic static ArrayList<StatementBlock> mergeFunctionCalls(List<StatementBlock> body, DMLProgram dmlProg) 
 - 
getOutputsofSBpublic ArrayList<DataIdentifier> getOutputsofSB() 
 - 
mergeStatementBlockspublic static ArrayList<StatementBlock> mergeStatementBlocks(List<StatementBlock> sb) 
 - 
rHoistFunctionCallsFromExpressionspublic static List<StatementBlock> rHoistFunctionCallsFromExpressions(StatementBlock current, DMLProgram prog) 
 - 
rHoistFunctionCallsFromExpressionspublic static List<Statement> rHoistFunctionCallsFromExpressions(Statement stmt, DMLProgram prog) 
 - 
rHoistFunctionCallsFromExpressionspublic static Expression rHoistFunctionCallsFromExpressions(Expression expr, boolean root, ArrayList<Statement> tmp, DMLProgram prog) 
 - 
rewriteFunctionCallStatementspublic ArrayList<Statement> rewriteFunctionCallStatements(DMLProgram dmlProg, ArrayList<Statement> statements) 
 - 
validatepublic VariableSet validate(DMLProgram dmlProg, VariableSet ids, HashMap<String,ConstIdentifier> constVars, boolean conditional) 
 - 
setStatementFormatTypepublic void setStatementFormatType(OutputStatement s, boolean conditionalValidate) 
 - 
setStatementFormatTypepublic void setStatementFormatType(AssignmentStatement s, boolean conditionalValidate) 
 - 
initializeforwardLVpublic VariableSet initializeforwardLV(VariableSet activeIn) For each statement: gen rule: for each variable read in current statement but not updated in any PRIOR statement, add to gen Handles case where variable both read and updated in same statement (i = i + 1, i needs to be added to gen) kill rule: for each variable updated in current statement but not read in this or any PRIOR statement, add to kill.- Specified by:
- initializeforwardLVin class- LiveVariableAnalysis
 
 - 
initializebackwardLVpublic VariableSet initializebackwardLV(VariableSet loPassed) - Specified by:
- initializebackwardLVin class- LiveVariableAnalysis
 
 - 
getConstInpublic HashMap<String,ConstIdentifier> getConstIn() 
 - 
getConstOutpublic HashMap<String,ConstIdentifier> getConstOut() 
 - 
analyzepublic VariableSet analyze(VariableSet loPassed) - Specified by:
- analyzein class- LiveVariableAnalysis
 
 - 
hasHopspublic boolean hasHops() 
 - 
updateRepetitionEstimatespublic void updateRepetitionEstimates(double repetitions) Updates the repetition estimate for this statement block and all contained hops. FunctionStatementBlocks are loaded from the function dictionary and repetitions are estimated for the contained statement blocks. This method is overridden in the subclasses of StatementBlock.- Parameters:
- repetitions- estimated for this statement block
 
 - 
raiseValidateErrorpublic void raiseValidateError(String msg, boolean conditional) 
 - 
raiseValidateErrorpublic void raiseValidateError(String msg, boolean conditional, String errorCode) 
 - 
setFilenamepublic void setFilename(String fname) - Specified by:
- setFilenamein interface- ParseInfo
 
 - 
setBeginLinepublic void setBeginLine(int passed) - Specified by:
- setBeginLinein interface- ParseInfo
 
 - 
setBeginColumnpublic void setBeginColumn(int passed) - Specified by:
- setBeginColumnin interface- ParseInfo
 
 - 
setEndLinepublic void setEndLine(int passed) - Specified by:
- setEndLinein interface- ParseInfo
 
 - 
setEndColumnpublic void setEndColumn(int passed) - Specified by:
- setEndColumnin interface- ParseInfo
 
 - 
setParseInfopublic void setParseInfo(ParseInfo parseInfo) Set parse information.- Parameters:
- parseInfo- parse information, such as beginning line position, beginning column position, ending line position, ending column position, text, and filename the DML filename (if it exists)
 
 - 
getFilenamepublic String getFilename() - Specified by:
- getFilenamein interface- ParseInfo
 
 - 
getBeginLinepublic int getBeginLine() - Specified by:
- getBeginLinein interface- ParseInfo
 
 - 
getBeginColumnpublic int getBeginColumn() - Specified by:
- getBeginColumnin interface- ParseInfo
 
 - 
getEndLinepublic int getEndLine() - Specified by:
- getEndLinein interface- ParseInfo
 
 - 
getEndColumnpublic int getEndColumn() - Specified by:
- getEndColumnin interface- ParseInfo
 
 - 
printErrorLocationpublic String printErrorLocation() 
 - 
printBlockErrorLocationpublic String printBlockErrorLocation() 
 - 
printWarningLocationpublic String printWarningLocation() 
 - 
updateRecompilationFlagpublic boolean updateRecompilationFlag() 
 - 
requiresRecompilationpublic boolean requiresRecompilation() 
 - 
setNondeterministicpublic void setNondeterministic(boolean flag) 
 - 
isNondeterministicpublic boolean isNondeterministic() 
 
- 
 
-