Changeset 11487 for branches/HeuristicLab.BottomUpTreeDistance
- Timestamp:
- 10/22/14 17:18:07 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.BottomUpTreeDistance/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SimilarityCalculators/BottomUpSimilarityCalculator.cs
r11486 r11487 79 79 80 80 // visit nodes in order of decreasing height to ensure correct mapping 81 foreach (var v in n1.IterateNodesPrefix().OrderByDescending(x => compactedGraph[x].Depth)) { 81 var nodes1 = n1.IterateNodesPrefix().ToList(); 82 var nodes2 = n2.IterateNodesPrefix().ToList(); 83 foreach (var v in nodes1) { 82 84 if (forwardMap.ContainsKey(v)) 83 85 continue; 84 86 var kv = compactedGraph[v]; 85 87 ISymbolicExpressionTreeNode w = null; 86 foreach (var t in n 2.IterateNodesPrefix()) {88 foreach (var t in nodes2) { 87 89 if (reverseMap.ContainsKey(t) || compactedGraph[t] != kv) 88 90 continue; … … 123 125 124 126 var nodes = n1.IterateNodesPostfix().Concat(n2.IterateNodesPostfix()); // the disjoint union F 125 var list = new List<GraphNode>(); // preallocate size to avoid list resizing as it has a performance hit127 var list = new List<GraphNode>(); 126 128 var queue = new Queue<ISymbolicExpressionTreeNode>(); 127 129
Note: See TracChangeset
for help on using the changeset viewer.