Package org.apache.sysds.hops.ipa
Class FunctionCallSizeInfo
- java.lang.Object
- 
- org.apache.sysds.hops.ipa.FunctionCallSizeInfo
 
- 
 public class FunctionCallSizeInfo extends Object Auxiliary data structure to hold function call summaries in terms of information about number of function calls, consistent dimensions, consistent sparsity, and dimension-preserving functions.
- 
- 
Constructor SummaryConstructors Constructor Description FunctionCallSizeInfo(FunctionCallGraph fgraph)Constructs the function call summary for all functions reachable from the main program.FunctionCallSizeInfo(FunctionCallGraph fgraph, boolean init)Constructs the function call summary for all functions reachable from the main program.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddDimsPreservingFunction(String fkey)Adds a function to the set of dimension-preserving functions.booleanequals(Object o)Set<String>getDimsPreservingFunctions()Gets the set of dimension-preserving functions, i.e., functions with one matrix input and output of equal dimension sizes.intgetFunctionCallCount(String fkey)Gets the number of function calls to a given function.Set<String>getInvalidFunctions()Gets the set of functions that are invalid for statistics propagation.Set<String>getValidFunctions()Gets the set of functions that are valid for statistics propagation.inthashCode()booleanhasSafeLiterals(String fkey)Indicates if the given function has at least one input that allows for safe literal propagation and replacement, i.e., all function calls have consistent literal inputs.booleanisDimsPreservingFunction(String fkey)Indicates if the given function belongs to the set of dimension-preserving functions.booleanisSafeLiteral(String fkey, int pos)Indicates if the given function input allows for safe literal propagation and replacement, i.e., all function calls have consistent literal inputs.booleanisSafeNnz(String fkey, int pos)Indicates if the given function input allows for safe nnz propagation, i.e., all function calls have a consistent number of non-zeros.booleanisValidFunction(String fkey)Indicates if the given function is valid for statistics propagation.StringtoString()
 
- 
- 
- 
Constructor Detail- 
FunctionCallSizeInfopublic FunctionCallSizeInfo(FunctionCallGraph fgraph) Constructs the function call summary for all functions reachable from the main program.- Parameters:
- fgraph- function call graph
 
 - 
FunctionCallSizeInfopublic FunctionCallSizeInfo(FunctionCallGraph fgraph, boolean init) Constructs the function call summary for all functions reachable from the main program.- Parameters:
- fgraph- function call graph
- init- initialize function candidates
 
 
- 
 - 
Method Detail- 
getFunctionCallCountpublic int getFunctionCallCount(String fkey) Gets the number of function calls to a given function.- Parameters:
- fkey- function key
- Returns:
- number of function calls
 
 - 
isValidFunctionpublic boolean isValidFunction(String fkey) Indicates if the given function is valid for statistics propagation.- Parameters:
- fkey- function key
- Returns:
- true if valid
 
 - 
getValidFunctionspublic Set<String> getValidFunctions() Gets the set of functions that are valid for statistics propagation.- Returns:
- set of function keys
 
 - 
getInvalidFunctionspublic Set<String> getInvalidFunctions() Gets the set of functions that are invalid for statistics propagation. This is literally the set of reachable functions minus the set of valid functions.- Returns:
- set of function keys.
 
 - 
addDimsPreservingFunctionpublic void addDimsPreservingFunction(String fkey) Adds a function to the set of dimension-preserving functions.- Parameters:
- fkey- function key
 
 - 
getDimsPreservingFunctionspublic Set<String> getDimsPreservingFunctions() Gets the set of dimension-preserving functions, i.e., functions with one matrix input and output of equal dimension sizes.- Returns:
- set of function keys
 
 - 
isDimsPreservingFunctionpublic boolean isDimsPreservingFunction(String fkey) Indicates if the given function belongs to the set of dimension-preserving functions.- Parameters:
- fkey- function key
- Returns:
- true if the function is dimension-preserving
 
 - 
isSafeNnzpublic boolean isSafeNnz(String fkey, int pos) Indicates if the given function input allows for safe nnz propagation, i.e., all function calls have a consistent number of non-zeros.- Parameters:
- fkey- function key
- pos- function input position
- Returns:
- true if nnz can safely be propagated
 
 - 
hasSafeLiteralspublic boolean hasSafeLiterals(String fkey) Indicates if the given function has at least one input that allows for safe literal propagation and replacement, i.e., all function calls have consistent literal inputs.- Parameters:
- fkey- function key
- Returns:
- true if a literal can be safely propagated
 
 - 
isSafeLiteralpublic boolean isSafeLiteral(String fkey, int pos) Indicates if the given function input allows for safe literal propagation and replacement, i.e., all function calls have consistent literal inputs.- Parameters:
- fkey- function key
- pos- function input position
- Returns:
- true if literal that can be safely propagated
 
 
- 
 
-