Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/26/17 23:13:15 (7 years ago)
Author:
abeham
Message:

#2730:

  • Unified implementation of all equality comparers and similarity calculators in BinaryVector, IntegerVector, RealVector, Permutation, and LinearLinkage encodings
  • Added Euclidean distance-based similarity calculators for real and integer vectors using a transformation function with scaling parameter
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/PermutationEqualityComparer.cs

    r14185 r15067  
    3030  public class PermutationEqualityComparer : EqualityComparer<Permutation> {
    3131    public override bool Equals(Permutation x, Permutation y) {
     32      if (x == null && y == null) return true;
     33      if (x == null || y == null) return false;
     34      if (ReferenceEquals(x, y)) return true;
     35      if (x.Length != y.Length) return false;
    3236      if (x.PermutationType != y.PermutationType) return false;
    33       if (x.Length != y.Length) return false;
    3437      switch (x.PermutationType) {
    3538        case PermutationTypes.Absolute:
     
    6770
    6871    public override int GetHashCode(Permutation obj) {
    69       if (obj == null) return 0;
     72      if (obj == null) throw new ArgumentNullException("obj", "PermutationEqualityComparer: Cannot compute hash value of null.");
    7073      return GenerateHashString(obj).GetHashCode();
    7174    }
Note: See TracChangeset for help on using the changeset viewer.