Free cookie consent management tool by TermsFeed Policy Generator

Changeset 16267


Ignore:
Timestamp:
11/01/18 19:33:45 (6 years ago)
Author:
bburlacu
Message:

#2950: Rename HashNode.IsChild property to IsLeaf

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  
    3838      public IComparer<T> Comparer;
    3939
    40       public bool IsChild => Arity == 0;
     40      public bool IsLeaf => Arity == 0;
    4141
    4242      public HashNode(IComparer<T> comparer) {
     
    9595      for (int i = 0; i < reduced.Length; ++i) {
    9696        var node = reduced[i];
    97         if (node.IsChild) {
     97        if (node.IsLeaf) {
    9898          continue;
    9999        }
     
    125125        var node = nodes[i];
    126126
    127         if (node.IsChild) {
     127        if (node.IsLeaf) {
    128128          continue;
    129129        }
     
    146146            foreach (var j in indices) {
    147147              var child = nodes[j];
    148               if (!child.IsChild) { // must copy complete subtree
     148              if (!child.IsLeaf) { // must copy complete subtree
    149149                Array.Copy(nodes, j - child.Size, sorted, idx, child.Size);
    150150                idx += child.Size;
     
    182182      for (int i = 0; i < nodes.Length; ++i) {
    183183        var node = nodes[i];
    184         if (node.IsChild) {
     184        if (node.IsLeaf) {
    185185          node.Size = 0;
    186186          continue;
     
    199199      for (int i = 0; i < nodes.Length; ++i) {
    200200        var node = nodes[i];
    201         if (node.IsChild || !node.IsCommutative) {
     201        if (node.IsLeaf || !node.IsCommutative) {
    202202          continue;
    203203        }
  • trunk/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Hashing/SymbolicExpressionTreeHash.cs

    r16263 r16267  
    5050
    5151      for (int i = 0; i < nodes.Length; ++i) {
    52         if (nodes[i].IsChild)
     52        if (nodes[i].IsLeaf)
    5353          continue;
    5454        nodes[i].CalculatedHashValue = nodes.ComputeHash(i);
     
    121121        var node = nodes[i];
    122122
    123         if (node.IsChild) {
     123        if (node.IsLeaf) {
    124124          if (node.Data is VariableTreeNode variable) {
    125125            var variableTreeNode = (VariableTreeNode)treeNodes[i];
Note: See TracChangeset for help on using the changeset viewer.