Lines Matching refs:Id2

82   bool identical(NodeId Id1, NodeId Id2) const;
85 bool isMatchingPossible(NodeId Id1, NodeId Id2) const;
88 bool haveSameParents(const Mapping &M, NodeId Id1, NodeId Id2) const;
92 void addOptimalMapping(Mapping &M, NodeId Id1, NodeId Id2) const;
96 double getJaccardSimilarity(const Mapping &M, NodeId Id1, NodeId Id2) const;
566 const SyntaxTree::Impl &T2, NodeId Id1, NodeId Id2) in ZhangShashaMatcher() argument
567 : DiffImpl(DiffImpl), S1(T1, Id1), S2(T2, Id2) { in ZhangShashaMatcher()
618 NodeId Id2 = S2.getIdInRoot(Col); in getMatchingNodes() local
619 assert(DiffImpl.isMatchingPossible(Id1, Id2) && in getMatchingNodes()
621 Matches.emplace_back(Id1, Id2); in getMatchingNodes()
644 double getUpdateCost(SNodeId Id1, SNodeId Id2) { in getUpdateCost() argument
645 if (!DiffImpl.isMatchingPossible(S1.getIdInRoot(Id1), S2.getIdInRoot(Id2))) in getUpdateCost()
647 return S1.getNodeValue(Id1) != S2.getNodeValue(Id2); in getUpdateCost()
652 for (SNodeId Id2 : S2.KeyRoots) in computeTreeDist() local
653 computeForestDist(Id1, Id2); in computeTreeDist()
656 void computeForestDist(SNodeId Id1, SNodeId Id2) { in computeForestDist() argument
657 assert(Id1 > 0 && Id2 > 0 && "Expecting offsets greater than 0."); in computeForestDist()
659 SNodeId LMD2 = S2.getLeftMostDescendant(Id2); in computeForestDist()
664 for (SNodeId D2 = LMD2 + 1; D2 <= Id2; ++D2) { in computeForestDist()
711 bool operator()(NodeId Id1, NodeId Id2) const { in operator ()()
712 return Tree.getNode(Id1).Height < Tree.getNode(Id2).Height; in operator ()()
756 bool ASTDiff::Impl::identical(NodeId Id1, NodeId Id2) const { in identical()
758 const Node &N2 = T2.getNode(Id2); in identical()
760 !isMatchingPossible(Id1, Id2) || in identical()
761 T1.getNodeValue(Id1) != T2.getNodeValue(Id2)) in identical()
769 bool ASTDiff::Impl::isMatchingPossible(NodeId Id1, NodeId Id2) const { in isMatchingPossible()
770 return Options.isMatchingAllowed(T1.getNode(Id1), T2.getNode(Id2)); in isMatchingPossible()
774 NodeId Id2) const { in haveSameParents()
776 NodeId P2 = T2.getNode(Id2).Parent; in haveSameParents()
782 NodeId Id2) const { in addOptimalMapping()
783 if (std::max(T1.getNumberOfDescendants(Id1), T2.getNumberOfDescendants(Id2)) > in addOptimalMapping()
786 ZhangShashaMatcher Matcher(*this, T1, T2, Id1, Id2); in addOptimalMapping()
797 NodeId Id2) const { in getJaccardSimilarity()
803 CommonDescendants += int(Dst.isValid() && T2.isInSubtree(Dst, Id2)); in getJaccardSimilarity()
807 T2.getNumberOfDescendants(Id2) - 1 - CommonDescendants; in getJaccardSimilarity()
818 for (NodeId Id2 : T2) { in findCandidate() local
819 if (!isMatchingPossible(Id1, Id2)) in findCandidate()
821 if (M.hasDst(Id2)) in findCandidate()
823 double Similarity = getJaccardSimilarity(M, Id1, Id2); in findCandidate()
826 Candidate = Id2; in findCandidate()
849 NodeId Id2 = findCandidate(M, Id1); in matchBottomUp() local
850 if (Id2.isValid()) { in matchBottomUp()
851 M.link(Id1, Id2); in matchBottomUp()
852 addOptimalMapping(M, Id1, Id2); in matchBottomUp()
883 for (NodeId Id2 : H2) { in matchTopDown() local
884 if (identical(Id1, Id2) && !M.hasSrc(Id1) && !M.hasDst(Id2)) { in matchTopDown()
886 M.link(Id1 + I, Id2 + I); in matchTopDown()
894 for (NodeId Id2 : H2) { in matchTopDown() local
895 if (!M.hasDst(Id2)) in matchTopDown()
896 L2.open(Id2); in matchTopDown()
923 for (NodeId Id2 : T2) { in computeChangeKinds() local
924 if (!M.hasDst(Id2)) { in computeChangeKinds()
925 T2.getMutableNode(Id2).Change = Insert; in computeChangeKinds()
926 T2.getMutableNode(Id2).Shift -= 1; in computeChangeKinds()
930 NodeId Id2 = M.getDst(Id1); in computeChangeKinds() local
931 if (Id2.isInvalid()) in computeChangeKinds()
933 if (!haveSameParents(M, Id1, Id2) || in computeChangeKinds()
935 T2.findPositionInParent(Id2, true)) { in computeChangeKinds()
937 T2.getMutableNode(Id2).Shift -= 1; in computeChangeKinds()
940 for (NodeId Id2 : T2.NodesBfs) { in computeChangeKinds() local
941 NodeId Id1 = M.getSrc(Id2); in computeChangeKinds()
945 Node &N2 = T2.getMutableNode(Id2); in computeChangeKinds()
948 if (!haveSameParents(M, Id1, Id2) || in computeChangeKinds()
950 T2.findPositionInParent(Id2, true)) { in computeChangeKinds()
953 if (T1.getNodeValue(Id1) != T2.getNodeValue(Id2)) { in computeChangeKinds()