Class TemplateBase
- java.lang.Object
- 
- org.apache.sysds.hops.codegen.template.TemplateBase
 
- 
- Direct Known Subclasses:
- TemplateCell,- TemplateOuterProduct,- TemplateRow
 
 public abstract class TemplateBase extends Object 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classTemplateBase.CloseTypestatic classTemplateBase.TemplateType
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract TemplateBase.CloseTypeclose(Hop hop)Indicates if the template must be closed at the current hop; either due to final operations (e.g., aggregate) or unsupported operations.abstract Pair<Hop[],CNodeTpl>constructCplan(Hop hop, CPlanMemoTable memo, boolean compileLiterals)Constructs a single cplan rooted at the given hop, according to the plan given in the memo structure for this particular hop and its recursive inputs.booleanequals(Object obj)abstract booleanfuse(Hop hop, Hop input)Indicates if the template can be expanded to the given hop starting from an open template at the input.TemplateBase.CloseTypegetCType()TemplateBase.TemplateTypegetType()inthashCode()booleanisClosed()abstract booleanmerge(Hop hop, Hop input)Indicates if the template at the current hop can be expanded by merging another template available for one of its other inputs which is not yet covered by the template of the current hop.abstract booleanopen(Hop hop)Indicates if this template can be opened at the given hop, where hop represents bottom (first operation on the inputs) of the fused operator.
 
- 
- 
- 
Method Detail- 
getTypepublic TemplateBase.TemplateType getType() 
 - 
getCTypepublic TemplateBase.CloseType getCType() 
 - 
isClosedpublic boolean isClosed() 
 - 
openpublic abstract boolean open(Hop hop) Indicates if this template can be opened at the given hop, where hop represents bottom (first operation on the inputs) of the fused operator.- Parameters:
- hop- current hop
- Returns:
- true if template can be opened
 
 - 
fusepublic abstract boolean fuse(Hop hop, Hop input) Indicates if the template can be expanded to the given hop starting from an open template at the input.- Parameters:
- hop- current hop
- input- hop with open template of same type
- Returns:
- true if the current hop can be fused into the operator.
 
 - 
mergepublic abstract boolean merge(Hop hop, Hop input) Indicates if the template at the current hop can be expanded by merging another template available for one of its other inputs which is not yet covered by the template of the current hop.- Parameters:
- hop- current hop
- input- direct input of current hop with available template
- Returns:
- true if the the input hop can be fused into the current hop
 
 - 
closepublic abstract TemplateBase.CloseType close(Hop hop) Indicates if the template must be closed at the current hop; either due to final operations (e.g., aggregate) or unsupported operations.- Parameters:
- hop- current hop
- Returns:
- close type (closed invalid, closed valid, open)
 
 - 
constructCplanpublic abstract Pair<Hop[],CNodeTpl> constructCplan(Hop hop, CPlanMemoTable memo, boolean compileLiterals) Constructs a single cplan rooted at the given hop, according to the plan given in the memo structure for this particular hop and its recursive inputs.- Parameters:
- hop- root of cplan
- memo- memoization table for partial subplans
- compileLiterals- if true compile non-integer literals as constants, otherwise variables. note: integer literals are always compiled as constants.
- Returns:
- pair containing hops and code template
 
 
- 
 
-