Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/11/19 15:32:31 (5 years ago)
Author:
bburlacu
Message:

#2950: Small refactor in HashExtensions.cs (better comparison, consistent use of the same hash function). Fix bug and improve robustness of SimplifyMultiplication in SymbolicExpressionHashExtensions.cs

File:
1 edited

Legend:

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

    r17076 r17132  
    4545
    4646      public int CompareTo(HashNode<T> other) {
    47         return CalculatedHashValue.CompareTo(other.CalculatedHashValue);
     47        var res = HashValue.CompareTo(other.HashValue);
     48        return res == 0 ? CalculatedHashValue.CompareTo(other.CalculatedHashValue) : res;
    4849      }
    4950
     
    112113          }
    113114          node.Simplify?.Invoke(ref nodes, i);
    114           for (int j = i - node.Size; j < i; ++j) {
     115          for (int j = i - node.Size; j <= i; ++j) {
    115116            // detect if anything was simplified
    116117            if (!nodes[j].Enabled) {
Note: See TracChangeset for help on using the changeset viewer.