Changeset 12694 for branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeNode.cs
- Timestamp:
- 07/09/15 13:07:30 (9 years ago)
- Location:
- branches/HeuristicLab.Problems.Orienteering
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Problems.Orienteering
- Property svn:mergeinfo changed
-
Property
svn:global-ignores
set to
*.nuget
packages
-
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding
- Property svn:mergeinfo changed
-
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeNode.cs
r11185 r12694 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 175 175 176 176 public IEnumerable<ISymbolicExpressionTreeNode> IterateNodesBreadth() { 177 var list = new List<ISymbolicExpressionTreeNode>( ) { this };177 var list = new List<ISymbolicExpressionTreeNode>(GetLength()) { this }; 178 178 int i = 0; 179 179 while (i != list.Count) { … … 193 193 public void ForEachNodePrefix(Action<ISymbolicExpressionTreeNode> a) { 194 194 a(this); 195 if (Subtrees != null) { 196 foreach (var subtree in Subtrees) { 197 subtree.ForEachNodePrefix(a); 195 if (subtrees != null) { 196 //avoid linq to reduce memory pressure 197 for (int i = 0; i < subtrees.Count; i++) { 198 subtrees[i].ForEachNodePrefix(a); 198 199 } 199 200 } … … 207 208 208 209 public void ForEachNodePostfix(Action<ISymbolicExpressionTreeNode> a) { 209 if (Subtrees != null) { 210 foreach (var subtree in Subtrees) { 211 subtree.ForEachNodePostfix(a); 210 if (subtrees != null) { 211 //avoid linq to reduce memory pressure 212 for (int i = 0; i < subtrees.Count; i++) { 213 subtrees[i].ForEachNodePostfix(a); 212 214 } 213 215 }
Note: See TracChangeset
for help on using the changeset viewer.