Changeset 16267
- Timestamp:
- 11/01/18 19:33:45 (6 years ago)
- Location:
- trunk/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Hashing
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Hashing/HashExtensions.cs
r16263 r16267 38 38 public IComparer<T> Comparer; 39 39 40 public bool Is Child=> Arity == 0;40 public bool IsLeaf => Arity == 0; 41 41 42 42 public HashNode(IComparer<T> comparer) { … … 95 95 for (int i = 0; i < reduced.Length; ++i) { 96 96 var node = reduced[i]; 97 if (node.Is Child) {97 if (node.IsLeaf) { 98 98 continue; 99 99 } … … 125 125 var node = nodes[i]; 126 126 127 if (node.Is Child) {127 if (node.IsLeaf) { 128 128 continue; 129 129 } … … 146 146 foreach (var j in indices) { 147 147 var child = nodes[j]; 148 if (!child.Is Child) { // must copy complete subtree148 if (!child.IsLeaf) { // must copy complete subtree 149 149 Array.Copy(nodes, j - child.Size, sorted, idx, child.Size); 150 150 idx += child.Size; … … 182 182 for (int i = 0; i < nodes.Length; ++i) { 183 183 var node = nodes[i]; 184 if (node.Is Child) {184 if (node.IsLeaf) { 185 185 node.Size = 0; 186 186 continue; … … 199 199 for (int i = 0; i < nodes.Length; ++i) { 200 200 var node = nodes[i]; 201 if (node.Is Child|| !node.IsCommutative) {201 if (node.IsLeaf || !node.IsCommutative) { 202 202 continue; 203 203 } -
trunk/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Hashing/SymbolicExpressionTreeHash.cs
r16263 r16267 50 50 51 51 for (int i = 0; i < nodes.Length; ++i) { 52 if (nodes[i].Is Child)52 if (nodes[i].IsLeaf) 53 53 continue; 54 54 nodes[i].CalculatedHashValue = nodes.ComputeHash(i); … … 121 121 var node = nodes[i]; 122 122 123 if (node.Is Child) {123 if (node.IsLeaf) { 124 124 if (node.Data is VariableTreeNode variable) { 125 125 var variableTreeNode = (VariableTreeNode)treeNodes[i];
Note: See TracChangeset
for help on using the changeset viewer.