Package org.apache.sysds.hops.rewrite
Class HopRewriteUtils
- java.lang.Object
-
- org.apache.sysds.hops.rewrite.HopRewriteUtils
-
public class HopRewriteUtils extends Object
-
-
Constructor Summary
Constructors Constructor Description HopRewriteUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidaddChildReference(Hop parent, Hop child)static voidaddChildReference(Hop parent, Hop child, int pos)static booleanalwaysRequiresReblock(Hop hop)static booleancheckAvgRowsGteCols(List<Hop> list)static booleancheckConsistentRows(List<Hop> list1, List<Hop> list2)static booleancheckInputDataTypes(Hop hop, Types.DataType... dt)static voidcleanupUnreferenced(Hop... inputs)static intcompareSize(Hop hop1, Hop hop2)Compares the size of outputs from hop1 and hop2, in terms of number of matrix cells.static booleancontainsInput(Hop current, Hop probe)static booleancontainsOp(ArrayList<Hop> candidates, Class<? extends Hop> clazz)static booleancontainsSecondOrderBuiltin(ArrayList<Hop> roots)static booleancontainsTransposeOperation(ArrayList<Hop> hops)static DataGenOpcopyDataGenOp(DataGenOp inputGen, double scale, double shift)Assumes that min and max are literal ops, needs to be checked from outside.static voidcopyLineNumbers(Hop src, Hop dest)static voidcopyLineNumbers(MatrixObject mo, Hop tread)static voidcopyLineNumbers(MatrixBlock mb, Hop tread)static AggUnaryOpcreateAggUnaryOp(Hop input, String op)static AggUnaryOpcreateAggUnaryOp(Hop input, Types.AggOp op, Types.Direction dir)static BinaryOpcreateBinary(Hop input1, Hop input2, String op)static BinaryOpcreateBinary(Hop input1, Hop input2, Types.OpOp2 op)static BinaryOpcreateBinary(Hop input1, Hop input2, Types.OpOp2 op, boolean outer)static BinaryOpcreateBinaryMinus(Hop input)static HopcreateComputeNnz(Hop input)static HopcreateDataGenOp(Hop rowInput, boolean tRowInput, Hop colInput, boolean tColInput, double value)static HopcreateDataGenOp(Hop input, double value)static HopcreateDataGenOp(Hop rowInput, Hop colInput, double value)static HopcreateDataGenOpByVal(ArrayList<LiteralOp> values, long rows, long cols)static HopcreateDataGenOpByVal(Hop rowInput, Hop colInput, Hop dimsInput, Types.DataType dt, Types.ValueType vt, double value)static DataOpcreateDataOp(String name, Hop in, Types.OpOpData type)static IndexingOpcreateIndexingOp(Hop input, long rix, long cix)static IndexingOpcreateIndexingOp(Hop input, long rl, long ru, long cl, long cu)static IndexingOpcreateIndexingOp(Hop input, Hop batchsize)static IndexingOpcreateIndexingOp(Hop input, Hop rl, Hop ru, Hop cl, Hop cu)static LeftIndexingOpcreateLeftIndexingOp(Hop lhs, Hop rhs, Hop rl, Hop ru, Hop cl, Hop cu)static AggBinaryOpcreateMatrixMultiply(Hop left, Hop right)static NaryOpcreateNary(Types.OpOpN op, Hop... inputs)static ParameterizedBuiltinOpcreateParameterizedBuiltinOp(Hop input, LinkedHashMap<String,Hop> args, Types.ParamBuiltinOp op)static HopcreatePartialTsmmCbind(Hop X, Hop deltaX, Hop tsmmIn1)static ReorgOpcreateReorg(ArrayList<Hop> inputs, Types.ReOrgOp rop)static ReorgOpcreateReorg(Hop input, String rop)static ReorgOpcreateReorg(Hop input, Types.ReOrgOp rop)static HopcreateScalarIndexing(Hop input, long rix, long cix)static DataGenOpcreateSeqDataGenOp(Hop input)static DataGenOpcreateSeqDataGenOp(Hop input, boolean asc)static DataGenOpcreateSeqDataGenOp(Hop proxy, Hop from, Hop to, Hop incr)static AggUnaryOpcreateSum(Hop input)static TernaryOpcreateTernary(Hop mleft, Hop smid, Hop mright, String opcode)static TernaryOpcreateTernary(Hop mleft, Hop smid, Hop mright, Types.OpOp3 op)static TernaryOpcreateTernary(Hop in1, Hop in2, Hop in3, Hop in4, Hop in5, Types.OpOp3 op)static DataOpcreateTransientRead(String name, Hop h)static DataOpcreateTransientRead(String name, MatrixObject mo)static DataOpcreateTransientRead(String name, MatrixBlock mb)static DataOpcreateTransientWrite(String name, Hop in)static ReorgOpcreateTranspose(Hop input)static AggBinaryOpcreateTsmm(Hop input, boolean left)static UnaryOpcreateUnary(Hop input, String type)static UnaryOpcreateUnary(Hop input, Types.OpOp1 type)static HopcreateValueHop(Hop hop, boolean row)static HopgetBasic1NSequenceMax(Hop hop)static booleangetBooleanValue(LiteralOp op)static booleangetBooleanValueSafe(LiteralOp op)static intgetChildReferencePos(Hop parent, Hop child)static HopgetDataGenOpConstantValue(Hop hop)static doublegetDoubleValue(LiteralOp op)static doublegetDoubleValueSafe(LiteralOp op)static longgetIntValue(LiteralOp op)Return the int value of a LiteralOp (as a long).static longgetIntValueSafe(Hop op)static longgetIntValueSafe(LiteralOp op)static HopgetLargestInput(Hop hop)static longgetMaxInputDim(Hop hop, boolean dim1)static longgetMaxInputDim(DataCharacteristics[] dc, boolean dim1)static longgetMaxNcolInput(Hop hop)static longgetMaxNrowInput(Hop hop)static HopgetOtherInput(Hop hop, Hop input)static ScalarObjectgetScalarObject(LiteralOp op)static longgetSumValidInputDims(Hop hop, boolean dim1)static longgetSumValidInputDims(DataCharacteristics[] mc, boolean dim1)static longgetSumValidInputNnz(Hop hop)static longgetSumValidInputNnz(DataCharacteristics[] mc, boolean worstcase)static intgetValidOpPos(Types.OpOp2 input, Types.OpOp2... validTab)static booleanhasListInputs(Hop hop)static booleanhasOnlyUnaryBinaryParents(Hop hop, boolean disallowLhs)static booleanhasOnlyWriteParents(Hop hop, boolean inclTransient, boolean inclPersistent)static booleanhasValidInputDims(Hop hop, boolean dim1)static booleanhasValidInputDims(DataCharacteristics[] mc, boolean dim1)static booleanhasValidInputNnz(Hop hop)static booleanhasValidInputNnz(DataCharacteristics[] mc, boolean worstcase)static booleanisAggUnaryOp(Hop hop, Types.AggOp... op)static booleanisAggUnaryOp(Hop hop, Types.AggOp op, Types.Direction dir)static booleanisBasic1NSequence(Hop hop)static booleanisBasic1NSequence(Hop seq, Hop input, boolean row)static booleanisBasicN1Sequence(Hop hop)static booleanisBinary(Hop hop, Types.OpOp2 type)static booleanisBinary(Hop hop, Types.OpOp2... types)static booleanisBinary(Hop hop, Types.OpOp2 type, int maxParents)static booleanisBinaryMatrixColVectorOperation(Hop hop)static booleanisBinaryMatrixMatrixOperation(Hop hop)static booleanisBinaryMatrixMatrixOperationWithSharedInput(Hop hop)static booleanisBinaryMatrixRowVectorOperation(Hop hop)static booleanisBinaryMatrixScalar(Hop hop, Types.OpOp2 type, double val)static booleanisBinaryMatrixScalarOperation(Hop hop)static booleanisBinaryPPred(Hop hop)static booleanisBinarySparseSafe(Hop hop)static booleanisColumnRangeIndexing(IndexingOp hop)static booleanisColumnRightIndexing(Hop hop)static booleanisConsecutiveIndex(Hop index, Hop index2)static booleanisData(Hop hop, Types.OpOpData type)static booleanisData(Hop hop, Types.OpOpData... types)static booleanisDataGenOp(Hop hop, Types.OpOpDG... ops)static booleanisDataGenOpWithConstantValue(Hop hop)static booleanisDataGenOpWithConstantValue(Hop hop, double value)static booleanisDataGenOpWithLiteralInputs(Hop hop, Types.OpOpDG... ops)static booleanisDataGenOpWithNonDeterminism(Hop hop)static booleanisDense(Hop hop)static booleanisDimsKnown(Hop hop)static booleanisDnn(Hop hop, Types.OpOpDnn type)static booleanisDnn(Hop hop, Types.OpOpDnn... types)static booleanisEmpty(Hop hop)static booleanisEqualMatrixSize(BinaryOp hop)static booleanisEqualSize(Hop hop1, Hop hop2)static booleanisEqualSize(Hop hop1, Hop... hops)static booleanisEqualValue(Hop hop1, Hop hop2)static booleanisEqualValue(LiteralOp hop1, LiteralOp hop2)static booleanisFullColumnIndexing(IndexingOp hop)static booleanisFullColumnIndexing(LeftIndexingOp hop)static booleanisFullRowIndexing(IndexingOp hop)static booleanisFullRowIndexing(LeftIndexingOp hop)static booleanisLastLevelStatementBlock(StatementBlock sb)static booleanisLiteralOfValue(Hop hop, boolean val)static booleanisLiteralOfValue(Hop hop, double val)static booleanisLiteralOfValue(Hop hop, Double... val)static booleanisLiteralOfValue(Hop hop, String val)static booleanisLoopStatementBlock(StatementBlock sb)static booleanisMatrixMultiply(Hop hop)static booleanisNary(Hop hop, Types.OpOpN type)static booleanisNary(Hop hop, Types.OpOpN... types)static booleanisNonZeroIndicator(Hop pred, Hop hop)static booleanisNotMatrixVectorBinaryOperation(Hop hop)static booleanisOuterBinary(Hop hop)static booleanisOuterProductLikeMM(Hop hop)static booleanisParameterBuiltinOp(Hop hop, Types.ParamBuiltinOp type)static booleanisRemoveEmpty(Hop hop)static booleanisRemoveEmpty(Hop hop, boolean rows)static booleanisReorg(Hop hop, Types.ReOrgOp type)static booleanisReorg(Hop hop, Types.ReOrgOp... types)static booleanisScalarMatrixBinaryMult(Hop hop)static booleanisSingleBlock(Hop hop)static booleanisSingleBlock(Hop hop, boolean cols)Checks our BLOCKSIZE CONSTRAINT, w/ awareness of forced single node execution mode.static booleanisSizeExpressionOf(Hop size, Hop input, boolean row)static booleanisSparse(Hop hop)static booleanisSparse(Hop hop, double threshold)static booleanisSum(Hop hop)static booleanisSumSq(Hop hop)static booleanisTerminalHop(Hop hop)Check if given hop is of a terminal type.static booleanisTernary(Hop hop, Types.OpOp3 type)static booleanisTernary(Hop hop, Types.OpOp3... types)static booleanisTransposeOfItself(Hop hop1, Hop hop2)static booleanisTransposeOperation(Hop hop)static booleanisTransposeOperation(Hop hop, int maxParents)static booleanisTsmm(Hop input)static booleanisTsmmInput(Hop input)static booleanisUnary(Hop hop, Types.OpOp1 type)static booleanisUnary(Hop hop, Types.OpOp1... types)static booleanisUnary(Hop hop, Types.OpOp1 type, int maxParents)static booleanisUnnecessaryRightIndexing(Hop hop)static booleanisValidOp(Types.AggOp input, Types.AggOp... validTab)static booleanisValidOp(Types.OpOp1 input, Types.OpOp1... validTab)static booleanisValidOp(Types.OpOp2 input, Types.OpOp2... validTab)static booleanisValidOp(Types.ParamBuiltinOp input, Types.ParamBuiltinOp... validTab)static booleanisValidOp(Types.ReOrgOp input, Types.ReOrgOp... validTab)static booleanisValidOuterBinaryOp(Types.OpOp2 op)static booleanisValueTypeCast(Types.OpOp1 op)static booleanknownParamservFunctions(Hop hop)static booleanknownParamservFunctions(Hop hop, DMLProgram prog)static booleanrContainsRead(Hop root, String var, boolean includeMetaOp)static voidrefreshOutputParameters(Hop hnew, Hop hold)static voidremoveAllChildReferences(Hop parent)static voidremoveChildReference(Hop parent, Hop child)static voidremoveChildReferenceByPos(Hop parent, Hop child, int posChild)static voidreplaceChildReference(Hop parent, Hop inOld, Hop inNew)static voidreplaceChildReference(Hop parent, Hop inOld, Hop inNew, int pos)static voidreplaceChildReference(Hop parent, Hop inOld, Hop inNew, int pos, boolean refresh)static HoprewireAllParentChildReferences(Hop hold, Hop hnew)Replace an old Hop with a replacement Hop.static booleanrHasSimpleReadChain(Hop root, String var)static voidsetOutputParameters(Hop hop, long rlen, long clen, int blen, long nnz)static voidsetOutputParametersForScalar(Hop hop)static voidsetUnoptimizedFunctionCalls(StatementBlock sb)static voidupdateHopCharacteristics(Hop hop, int blen, Hop src)static voidupdateHopCharacteristics(Hop hop, int blen, MemoTable memo, Hop src)
-
-
-
Method Detail
-
isValueTypeCast
public static boolean isValueTypeCast(Types.OpOp1 op)
-
getBooleanValue
public static boolean getBooleanValue(LiteralOp op)
-
getBooleanValueSafe
public static boolean getBooleanValueSafe(LiteralOp op)
-
getDoubleValue
public static double getDoubleValue(LiteralOp op)
-
getDoubleValueSafe
public static double getDoubleValueSafe(LiteralOp op)
-
getIntValue
public static long getIntValue(LiteralOp op)
Return the int value of a LiteralOp (as a long). Note: For comparisons, this is *only* to be used in situations in which the value is absolutely guaranteed to be an integer. Otherwise, a safer alternative is `getDoubleValue`.- Parameters:
op- literal operator- Returns:
- long value of literal op
-
getIntValueSafe
public static long getIntValueSafe(Hop op)
-
getIntValueSafe
public static long getIntValueSafe(LiteralOp op)
-
isLiteralOfValue
public static boolean isLiteralOfValue(Hop hop, double val)
-
isLiteralOfValue
public static boolean isLiteralOfValue(Hop hop, boolean val)
-
getScalarObject
public static ScalarObject getScalarObject(LiteralOp op)
-
removeChildReferenceByPos
public static void removeChildReferenceByPos(Hop parent, Hop child, int posChild)
-
removeAllChildReferences
public static void removeAllChildReferences(Hop parent)
-
rewireAllParentChildReferences
public static Hop rewireAllParentChildReferences(Hop hold, Hop hnew)
Replace an old Hop with a replacement Hop. If the old Hop has no parents, then return the replacement. Otherwise rewire each of the Hop's parents into the replacement and return the replacement.- Parameters:
hold- To be replacedhnew- The replacement- Returns:
- hnew
-
replaceChildReference
public static void replaceChildReference(Hop parent, Hop inOld, Hop inNew, int pos)
-
replaceChildReference
public static void replaceChildReference(Hop parent, Hop inOld, Hop inNew, int pos, boolean refresh)
-
cleanupUnreferenced
public static void cleanupUnreferenced(Hop... inputs)
-
copyDataGenOp
public static DataGenOp copyDataGenOp(DataGenOp inputGen, double scale, double shift)
Assumes that min and max are literal ops, needs to be checked from outside.- Parameters:
inputGen- input data gen opscale- the scaleshift- the shift- Returns:
- data gen op
-
createDataGenOp
public static Hop createDataGenOp(Hop rowInput, boolean tRowInput, Hop colInput, boolean tColInput, double value)
-
createDataGenOpByVal
public static Hop createDataGenOpByVal(Hop rowInput, Hop colInput, Hop dimsInput, Types.DataType dt, Types.ValueType vt, double value)
-
createDataGenOpByVal
public static Hop createDataGenOpByVal(ArrayList<LiteralOp> values, long rows, long cols)
-
isDataGenOp
public static boolean isDataGenOp(Hop hop, Types.OpOpDG... ops)
-
isDataGenOpWithLiteralInputs
public static boolean isDataGenOpWithLiteralInputs(Hop hop, Types.OpOpDG... ops)
-
isDataGenOpWithConstantValue
public static boolean isDataGenOpWithConstantValue(Hop hop)
-
isDataGenOpWithConstantValue
public static boolean isDataGenOpWithConstantValue(Hop hop, double value)
-
isDataGenOpWithNonDeterminism
public static boolean isDataGenOpWithNonDeterminism(Hop hop)
-
createTransientRead
public static DataOp createTransientRead(String name, MatrixBlock mb)
-
createTransientRead
public static DataOp createTransientRead(String name, MatrixObject mo)
-
createDataOp
public static DataOp createDataOp(String name, Hop in, Types.OpOpData type)
-
createReorg
public static ReorgOp createReorg(Hop input, Types.ReOrgOp rop)
-
createReorg
public static ReorgOp createReorg(ArrayList<Hop> inputs, Types.ReOrgOp rop)
-
createUnary
public static UnaryOp createUnary(Hop input, Types.OpOp1 type)
-
createBinary
public static BinaryOp createBinary(Hop input1, Hop input2, Types.OpOp2 op)
-
createBinary
public static BinaryOp createBinary(Hop input1, Hop input2, Types.OpOp2 op, boolean outer)
-
createSum
public static AggUnaryOp createSum(Hop input)
-
createAggUnaryOp
public static AggUnaryOp createAggUnaryOp(Hop input, String op)
-
createAggUnaryOp
public static AggUnaryOp createAggUnaryOp(Hop input, Types.AggOp op, Types.Direction dir)
-
createTsmm
public static AggBinaryOp createTsmm(Hop input, boolean left)
-
createMatrixMultiply
public static AggBinaryOp createMatrixMultiply(Hop left, Hop right)
-
createParameterizedBuiltinOp
public static ParameterizedBuiltinOp createParameterizedBuiltinOp(Hop input, LinkedHashMap<String,Hop> args, Types.ParamBuiltinOp op)
-
createIndexingOp
public static IndexingOp createIndexingOp(Hop input, Hop batchsize)
-
createIndexingOp
public static IndexingOp createIndexingOp(Hop input, long rix, long cix)
-
createIndexingOp
public static IndexingOp createIndexingOp(Hop input, long rl, long ru, long cl, long cu)
-
createIndexingOp
public static IndexingOp createIndexingOp(Hop input, Hop rl, Hop ru, Hop cl, Hop cu)
-
createLeftIndexingOp
public static LeftIndexingOp createLeftIndexingOp(Hop lhs, Hop rhs, Hop rl, Hop ru, Hop cl, Hop cu)
-
createNary
public static NaryOp createNary(Types.OpOpN op, Hop... inputs)
-
createSeqDataGenOp
public static DataGenOp createSeqDataGenOp(Hop proxy, Hop from, Hop to, Hop incr)
-
createTernary
public static TernaryOp createTernary(Hop mleft, Hop smid, Hop mright, String opcode)
-
createTernary
public static TernaryOp createTernary(Hop mleft, Hop smid, Hop mright, Types.OpOp3 op)
-
createTernary
public static TernaryOp createTernary(Hop in1, Hop in2, Hop in3, Hop in4, Hop in5, Types.OpOp3 op)
-
setOutputParameters
public static void setOutputParameters(Hop hop, long rlen, long clen, int blen, long nnz)
-
setOutputParametersForScalar
public static void setOutputParametersForScalar(Hop hop)
-
copyLineNumbers
public static void copyLineNumbers(MatrixBlock mb, Hop tread)
-
copyLineNumbers
public static void copyLineNumbers(MatrixObject mo, Hop tread)
-
updateHopCharacteristics
public static void updateHopCharacteristics(Hop hop, int blen, MemoTable memo, Hop src)
-
isDimsKnown
public static boolean isDimsKnown(Hop hop)
-
isEmpty
public static boolean isEmpty(Hop hop)
-
isEqualMatrixSize
public static boolean isEqualMatrixSize(BinaryOp hop)
-
isSingleBlock
public static boolean isSingleBlock(Hop hop)
-
isSingleBlock
public static boolean isSingleBlock(Hop hop, boolean cols)
Checks our BLOCKSIZE CONSTRAINT, w/ awareness of forced single node execution mode.- Parameters:
hop- high-level operatorcols- true if cols- Returns:
- true if single block
-
isOuterProductLikeMM
public static boolean isOuterProductLikeMM(Hop hop)
-
isOuterBinary
public static boolean isOuterBinary(Hop hop)
-
isValidOuterBinaryOp
public static boolean isValidOuterBinaryOp(Types.OpOp2 op)
-
isSparse
public static boolean isSparse(Hop hop)
-
isDense
public static boolean isDense(Hop hop)
-
isSparse
public static boolean isSparse(Hop hop, double threshold)
-
isNotMatrixVectorBinaryOperation
public static boolean isNotMatrixVectorBinaryOperation(Hop hop)
-
isReorg
public static boolean isReorg(Hop hop, Types.ReOrgOp type)
-
isReorg
public static boolean isReorg(Hop hop, Types.ReOrgOp... types)
-
isTransposeOperation
public static boolean isTransposeOperation(Hop hop)
-
isTransposeOperation
public static boolean isTransposeOperation(Hop hop, int maxParents)
-
isTsmm
public static boolean isTsmm(Hop input)
-
isTsmmInput
public static boolean isTsmmInput(Hop input)
-
isBinary
public static boolean isBinary(Hop hop, Types.OpOp2 type)
-
isBinary
public static boolean isBinary(Hop hop, Types.OpOp2... types)
-
isBinary
public static boolean isBinary(Hop hop, Types.OpOp2 type, int maxParents)
-
isBinaryPPred
public static boolean isBinaryPPred(Hop hop)
-
isBinarySparseSafe
public static boolean isBinarySparseSafe(Hop hop)
-
isBinaryMatrixScalarOperation
public static boolean isBinaryMatrixScalarOperation(Hop hop)
-
isBinaryMatrixMatrixOperation
public static boolean isBinaryMatrixMatrixOperation(Hop hop)
-
isBinaryMatrixMatrixOperationWithSharedInput
public static boolean isBinaryMatrixMatrixOperationWithSharedInput(Hop hop)
-
isBinaryMatrixScalar
public static boolean isBinaryMatrixScalar(Hop hop, Types.OpOp2 type, double val)
-
isTernary
public static boolean isTernary(Hop hop, Types.OpOp3 type)
-
isTernary
public static boolean isTernary(Hop hop, Types.OpOp3... types)
-
isData
public static boolean isData(Hop hop, Types.OpOpData... types)
-
isData
public static boolean isData(Hop hop, Types.OpOpData type)
-
isBinaryMatrixColVectorOperation
public static boolean isBinaryMatrixColVectorOperation(Hop hop)
-
isBinaryMatrixRowVectorOperation
public static boolean isBinaryMatrixRowVectorOperation(Hop hop)
-
isUnary
public static boolean isUnary(Hop hop, Types.OpOp1 type)
-
isUnary
public static boolean isUnary(Hop hop, Types.OpOp1 type, int maxParents)
-
isUnary
public static boolean isUnary(Hop hop, Types.OpOp1... types)
-
isTerminalHop
public static boolean isTerminalHop(Hop hop)
Check if given hop is of a terminal type. Terminal hops are either of type print or write.- Parameters:
hop- for which the type is checked- Returns:
- true if hop is terminal
-
isMatrixMultiply
public static boolean isMatrixMultiply(Hop hop)
-
isAggUnaryOp
public static boolean isAggUnaryOp(Hop hop, Types.AggOp op, Types.Direction dir)
-
isAggUnaryOp
public static boolean isAggUnaryOp(Hop hop, Types.AggOp... op)
-
isSum
public static boolean isSum(Hop hop)
-
isSumSq
public static boolean isSumSq(Hop hop)
-
isParameterBuiltinOp
public static boolean isParameterBuiltinOp(Hop hop, Types.ParamBuiltinOp type)
-
isRemoveEmpty
public static boolean isRemoveEmpty(Hop hop, boolean rows)
-
isRemoveEmpty
public static boolean isRemoveEmpty(Hop hop)
-
isNary
public static boolean isNary(Hop hop, Types.OpOpN type)
-
isNary
public static boolean isNary(Hop hop, Types.OpOpN... types)
-
isDnn
public static boolean isDnn(Hop hop, Types.OpOpDnn type)
-
isDnn
public static boolean isDnn(Hop hop, Types.OpOpDnn... types)
-
checkInputDataTypes
public static boolean checkInputDataTypes(Hop hop, Types.DataType... dt)
-
isColumnRightIndexing
public static boolean isColumnRightIndexing(Hop hop)
-
isFullColumnIndexing
public static boolean isFullColumnIndexing(LeftIndexingOp hop)
-
isFullColumnIndexing
public static boolean isFullColumnIndexing(IndexingOp hop)
-
isFullRowIndexing
public static boolean isFullRowIndexing(LeftIndexingOp hop)
-
isFullRowIndexing
public static boolean isFullRowIndexing(IndexingOp hop)
-
isColumnRangeIndexing
public static boolean isColumnRangeIndexing(IndexingOp hop)
-
isUnnecessaryRightIndexing
public static boolean isUnnecessaryRightIndexing(Hop hop)
-
isScalarMatrixBinaryMult
public static boolean isScalarMatrixBinaryMult(Hop hop)
-
isBasic1NSequence
public static boolean isBasic1NSequence(Hop hop)
-
isBasicN1Sequence
public static boolean isBasicN1Sequence(Hop hop)
-
hasOnlyWriteParents
public static boolean hasOnlyWriteParents(Hop hop, boolean inclTransient, boolean inclPersistent)
-
hasOnlyUnaryBinaryParents
public static boolean hasOnlyUnaryBinaryParents(Hop hop, boolean disallowLhs)
-
alwaysRequiresReblock
public static boolean alwaysRequiresReblock(Hop hop)
-
isValidOp
public static boolean isValidOp(Types.AggOp input, Types.AggOp... validTab)
-
isValidOp
public static boolean isValidOp(Types.OpOp1 input, Types.OpOp1... validTab)
-
isValidOp
public static boolean isValidOp(Types.OpOp2 input, Types.OpOp2... validTab)
-
isValidOp
public static boolean isValidOp(Types.ReOrgOp input, Types.ReOrgOp... validTab)
-
isValidOp
public static boolean isValidOp(Types.ParamBuiltinOp input, Types.ParamBuiltinOp... validTab)
-
getValidOpPos
public static int getValidOpPos(Types.OpOp2 input, Types.OpOp2... validTab)
-
compareSize
public static int compareSize(Hop hop1, Hop hop2)
Compares the size of outputs from hop1 and hop2, in terms of number of matrix cells.- Parameters:
hop1- high-level operator 1hop2- high-level operator 2- Returns:
- 0 if sizes are equal, <0 for hop1<hop2, >0 for hop1>hop2.
-
isLastLevelStatementBlock
public static boolean isLastLevelStatementBlock(StatementBlock sb)
-
isLoopStatementBlock
public static boolean isLoopStatementBlock(StatementBlock sb)
-
getMaxNrowInput
public static long getMaxNrowInput(Hop hop)
-
getMaxNcolInput
public static long getMaxNcolInput(Hop hop)
-
getMaxInputDim
public static long getMaxInputDim(Hop hop, boolean dim1)
-
getSumValidInputDims
public static long getSumValidInputDims(Hop hop, boolean dim1)
-
hasValidInputDims
public static boolean hasValidInputDims(Hop hop, boolean dim1)
-
getSumValidInputNnz
public static long getSumValidInputNnz(Hop hop)
-
hasValidInputNnz
public static boolean hasValidInputNnz(Hop hop)
-
getMaxInputDim
public static long getMaxInputDim(DataCharacteristics[] dc, boolean dim1)
-
getSumValidInputDims
public static long getSumValidInputDims(DataCharacteristics[] mc, boolean dim1)
-
hasValidInputDims
public static boolean hasValidInputDims(DataCharacteristics[] mc, boolean dim1)
-
getSumValidInputNnz
public static long getSumValidInputNnz(DataCharacteristics[] mc, boolean worstcase)
-
hasValidInputNnz
public static boolean hasValidInputNnz(DataCharacteristics[] mc, boolean worstcase)
-
hasListInputs
public static boolean hasListInputs(Hop hop)
-
knownParamservFunctions
public static boolean knownParamservFunctions(Hop hop)
-
knownParamservFunctions
public static boolean knownParamservFunctions(Hop hop, DMLProgram prog)
-
setUnoptimizedFunctionCalls
public static void setUnoptimizedFunctionCalls(StatementBlock sb)
-
-