Class LoopVertex

    • Constructor Detail

      • LoopVertex

        public LoopVertex​(java.lang.String compositeTransformFullName)
        The LoopVertex constructor.
        Parameters:
        compositeTransformFullName - full name of the composite transform.
    • Method Detail

      • getClone

        public final LoopVertex getClone()
        Description copied from interface: Cloneable
        Creates and returns a copy of this object.

        The precise meaning of "copy" may depend on the class of the object. The general intent is that, all fields of the object are copied.

        Returns:
        a clone of this object.
      • getDAG

        public DAG<IRVertex,​IREdge> getDAG()
        Returns:
        the DAG of the LoopVertex
      • getName

        public java.lang.String getName()
        Returns:
        the full name of the composite transform.
      • mapEdgeWithLoop

        public void mapEdgeWithLoop​(IREdge edgeWithLoop,
                                    IREdge edgeWithInternalVertex)
        Maps an edge from/to loop with the corresponding edge from/to internal vertex.
        Parameters:
        edgeWithLoop - an edge from/to loop
        edgeWithInternalVertex - the corresponding edge from/to internal vertex
      • getEdgeWithLoop

        public IREdge getEdgeWithLoop​(IREdge edgeWithInternalVertex)
        Parameters:
        edgeWithInternalVertex - an edge with internal vertex
        Returns:
        the corresponding edge with loop for the specified edge with internal vertex
      • getEdgeWithInternalVertex

        public IREdge getEdgeWithInternalVertex​(IREdge edgeWithLoop)
        Parameters:
        edgeWithLoop - an edge with loop
        Returns:
        the corresponding edge with internal vertex for the specified edge with loop
      • getEdgeWithLoopToEdgeWithInternalVertex

        public java.util.Map<IREdge,​IREdge> getEdgeWithLoopToEdgeWithInternalVertex()
        Getter method for edgeWithLoopToEdgeWithInternalVertex.
        Returns:
        the map of edge with loop to the edge with the internal vertex.
      • getEdgeWithInternalVertexToEdgeWithLoop

        public java.util.Map<IREdge,​IREdge> getEdgeWithInternalVertexToEdgeWithLoop()
        Getter method for edgeWithInternalVertexToEdgeWithLoop.
        Returns:
        the map of edge with internal vertex to the edge with the loop.
      • addDagIncomingEdge

        public void addDagIncomingEdge​(IREdge edge)
        Adds the incoming edge of the contained DAG.
        Parameters:
        edge - edge to add.
      • getDagIncomingEdges

        public java.util.Map<IRVertex,​java.util.Set<IREdge>> getDagIncomingEdges()
        Returns:
        incoming edges of the contained DAG.
      • removeDagIncomingEdge

        public void removeDagIncomingEdge​(IREdge edge)
        Removes the incoming edge of the contained DAG.
        Parameters:
        edge - edge to remove
      • addIterativeIncomingEdge

        public void addIterativeIncomingEdge​(IREdge edge)
        Adds an iterative incoming edge, from the previous iteration, but connection internally.
        Parameters:
        edge - edge to add.
      • getIterativeIncomingEdges

        public java.util.Map<IRVertex,​java.util.Set<IREdge>> getIterativeIncomingEdges()
        Returns:
        the iterative incoming edges inside the DAG.
      • removeIterativeIncomingEdge

        public void removeIterativeIncomingEdge​(IREdge edge)
        Remove an iterative incoming edge.
        Parameters:
        edge - edge to remove
      • addNonIterativeIncomingEdge

        public void addNonIterativeIncomingEdge​(IREdge edge)
        Adds a non-iterative incoming edge, from outside the previous iteration.
        Parameters:
        edge - edge to add.
      • getNonIterativeIncomingEdges

        public java.util.Map<IRVertex,​java.util.Set<IREdge>> getNonIterativeIncomingEdges()
        Returns:
        the non-iterative incoming edges of the LoopVertex.
      • removeNonIterativeIncomingEdge

        public void removeNonIterativeIncomingEdge​(IREdge edge)
        Removes non iterative incoming edge.
        Parameters:
        edge - edge to remove.
      • addDagOutgoingEdge

        public void addDagOutgoingEdge​(IREdge edge)
        Adds and outgoing edge of the contained DAG.
        Parameters:
        edge - edge to add.
      • getDagOutgoingEdges

        public java.util.Map<IRVertex,​java.util.Set<IREdge>> getDagOutgoingEdges()
        Returns:
        outgoing edges of the contained DAG.
      • removeDagOutgoingEdge

        public void removeDagOutgoingEdge​(IREdge edge)
        Removes a dag outgoing edge.
        Parameters:
        edge - edge to remove.
      • markDuplicateEdges

        public void markDuplicateEdges()
        Marks duplicate edges with DuplicateEdgeGroupProperty.
      • unRollIteration

        public LoopVertex unRollIteration​(DAGBuilder<IRVertex,​IREdge> dagBuilder)
        Method for unrolling an iteration of the LoopVertex. So basically, in the original place of a LoopVertex, it puts a clone of the sub-DAG that iterates, and appends the LoopVertex after that, until the termination condition has been met.
        Parameters:
        dagBuilder - DAGBuilder to add the unrolled iteration to.
        Returns:
        a LoopVertex with one less maximum iteration.
      • loopTerminationConditionMet

        public java.lang.Boolean loopTerminationConditionMet()
        Returns:
        whether or not the loop termination condition has been met.
      • loopTerminationConditionMet

        public java.lang.Boolean loopTerminationConditionMet​(java.lang.Integer intPredicateInput)
        Parameters:
        intPredicateInput - input for the intPredicate of the loop termination condition.
        Returns:
        whether or not the loop termination condition has been met.
      • setMaxNumberOfIterations

        public void setMaxNumberOfIterations​(java.lang.Integer maxNum)
        Set the maximum number of iterations.
        Parameters:
        maxNum - maximum number of iterations.
      • getTerminationCondition

        public java.util.function.IntPredicate getTerminationCondition()
        Returns:
        termination condition int predicate.
      • getMaxNumberOfIterations

        public java.lang.Integer getMaxNumberOfIterations()
        Returns:
        maximum number of iterations.
      • increaseMaxNumberOfIterations

        public void increaseMaxNumberOfIterations()
        increase the value of maximum number of iterations by 1.
      • decreaseMaxNumberOfIterations

        protected void decreaseMaxNumberOfIterations()
        decrease the value of maximum number of iterations by 1.
      • terminationConditionEquals

        public boolean terminationConditionEquals​(LoopVertex that)
        Check termination condition.
        Parameters:
        that - another vertex.
        Returns:
        true if equals.
      • setTerminationCondition

        public void setTerminationCondition​(java.util.function.IntPredicate terminationCondition)
        Set the intPredicate termination condition for the LoopVertex.
        Parameters:
        terminationCondition - the termination condition to set.
      • getPropertiesAsJsonNode

        public final com.fasterxml.jackson.databind.node.ObjectNode getPropertiesAsJsonNode()
        Parse Properties to JsonNode.
        Overrides:
        getPropertiesAsJsonNode in class Vertex
        Returns:
        JSON representation of additional properties