Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/19/18 15:30:44 (6 years ago)
Author:
bburlacu
Message:

#2950: Change Simplify inside HashNode to a delegate (instead of an Action) so that the nodes array can be passed as ref. This enables us to resize/alter the nodes array during simplification (eg, by performing term expansion or similar operations)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Hashing/HashExtensions.cs

    r16273 r16305  
    3535      public ulong CalculatedHashValue; // the calculated hash value (taking into account the children hash values)
    3636
    37       public Action<HashNode<T>[], int> Simplify;
     37      public delegate void SimplifyAction(ref HashNode<T>[] nodes, int i);
     38      public SimplifyAction Simplify;
     39
    3840      public IComparer<T> Comparer;
    3941
     
    108110          continue;
    109111        }
    110         node.Simplify?.Invoke(reduced, i);
     112        node.Simplify?.Invoke(ref reduced, i);
    111113      }
    112114      // detect if anything was simplified
Note: See TracChangeset for help on using the changeset viewer.