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.BinaryVectorEncoding/3.3/SimilarityCalculators/HammingSimilarityCalculator.cs

    r14659 r15067  
    4545    public static double CalculateSimilarity(BinaryVector left, BinaryVector right) {
    4646      if (left == null || right == null)
    47         throw new ArgumentException("Cannot calculate similarity because one or both of the provided scopes is null.");
     47        throw new ArgumentException("Cannot calculate similarity because one or both of the provided solutions is null.");
    4848      if (left.Length != right.Length)
    4949        throw new ArgumentException("Cannot calculate similarity because the provided solutions have different lengths.");
    50       if (left == right) return 1.0;
     50      if (left.Length == 0)
     51        throw new ArgumentException("Cannot calculate similarity because solutions are of length 0.");
     52      if (ReferenceEquals(left, right)) return 1.0;
    5153
    5254      double similarity = 0.0;
Note: See TracChangeset for help on using the changeset viewer.