Changeset 12951 for branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching
- Timestamp:
- 09/15/15 00:10:33 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/QueryMatch.cs
r12942 r12951 42 42 public QueryMatch(ISymbolicExpressionTreeNodeEqualityComparer comparer) { 43 43 this.comparer = comparer; 44 } 45 46 public bool Match(ISymbolicExpressionTree data, ISymbolicExpressionTree query) { 47 return Match(data.Root.GetSubtree(0).GetSubtree(0), query.Root.GetSubtree(0).GetSubtree(0)); 44 48 } 45 49 … … 100 104 if (qTree.Index < qHedge.Index) { 101 105 var rtop = Rtop(qTree.Next, qHedge); 102 while (rtop.Index < qHedge.Next.Index&& qHedge.Index < rtop.LastSibling.Index) {106 while (rtop.Index < int.MaxValue && qHedge.Index < rtop.LastSibling.Index) { 103 107 qTree = Tmatch(d, rtop.Next, rtop.LastSibling); 104 108 rtop = Rtop(qTree.Next, qHedge); … … 108 112 } else { 109 113 var rtop = Rtop(qHedge.Next, qTree); 110 while (rtop.Index < qTree.Next.Index&& qTree.Index < rtop.LastSibling.Index) {114 while (rtop.Index < int.MaxValue && qTree.Index < rtop.LastSibling.Index) { 111 115 qHedge = Hmatch(d.PreviousSibling, rtop.Next, rtop.LastSibling); 112 116 rtop = Rtop(qHedge.Next, qTree); … … 123 127 return hUntil; 124 128 if (hFrom.Index > hUntil.Index) 125 return hFrom.Next;129 return new NodeInfo { Node = null, Index = int.MaxValue }; 126 130 // let u be the highest ancestor of hUntil that has a previous sibling s such that s >= hFrom 127 131 // if no such u exists, then Rtop(hFrom, hUntil) = hUntil. Otherwise, rtop(hFrom, hUntil) = s 128 if (hUntil.Parent == null)129 return hUntil;130 131 132 NodeInfo rtop = null; 132 133 List<NodeInfo> ancestors = hUntil.Ancestors.ToList();
Note: See TracChangeset
for help on using the changeset viewer.