Changeset 13579
- Timestamp:
- 01/29/16 17:04:19 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeNode.cs
r12509 r13579 106 106 if (length > 0) return length; 107 107 else { 108 length= 1;108 ushort l = 1; 109 109 if (subtrees != null) { 110 110 for (int i = 0; i < subtrees.Count; i++) { 111 checked { l ength+= (ushort)subtrees[i].GetLength(); }111 checked { l += (ushort)subtrees[i].GetLength(); } 112 112 } 113 113 } 114 length = l; 114 115 return length; 115 116 } … … 119 120 if (depth > 0) return depth; 120 121 else { 122 ushort d = 0; 121 123 if (subtrees != null) { 122 for (int i = 0; i < subtrees.Count; i++) depth = Math.Max(depth, (ushort)subtrees[i].GetDepth()); 123 } 124 depth++; 124 for (int i = 0; i < subtrees.Count; i++) d = Math.Max(d, (ushort)subtrees[i].GetDepth()); 125 } 126 d++; 127 depth = d; 125 128 return depth; 126 129 }
Note: See TracChangeset
for help on using the changeset viewer.