Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/07/17 09:50:11 (7 years ago)
Author:
jkarder
Message:

#2706: QAPSimilarityCalculator now throws an exception if both permutations are of length 0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.QuadraticAssignment/3.3/QAPSimilarityCalculator.cs

    r15069 r15166  
    6262      if (left.Length != right.Length)
    6363        throw new ArgumentException("Cannot calculate similarity because the provided solutions have different lengths.");
    64       if (object.ReferenceEquals(left, right)) return 1.0;
     64      if (left.Length == 0)
     65        throw new ArgumentException("Cannot calculate similarity because solutions are of length 0.");
     66      if (ReferenceEquals(left, right)) return 1.0;
    6567
    6668      return QAPPermutationProximityCalculator.CalculatePhenotypeSimilarity(left, right, weights, distances);
Note: See TracChangeset for help on using the changeset viewer.