Changeset 15256 for branches/PerformanceComparison/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/SimilarityCalculators
- Timestamp:
- 07/15/17 14:25:44 (8 years ago)
- Location:
- branches/PerformanceComparison/HeuristicLab.Encodings.BinaryVectorEncoding
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PerformanceComparison/HeuristicLab.Encodings.BinaryVectorEncoding
- Property svn:mergeinfo changed
-
branches/PerformanceComparison/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/SimilarityCalculators/HammingSimilarityCalculator.cs
r14659 r15256 45 45 public static double CalculateSimilarity(BinaryVector left, BinaryVector right) { 46 46 if (left == null || right == null) 47 throw new ArgumentException("Cannot calculate similarity because one or both of the provided s copes is null.");47 throw new ArgumentException("Cannot calculate similarity because one or both of the provided solutions is null."); 48 48 if (left.Length != right.Length) 49 49 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; 51 53 52 54 double similarity = 0.0;
Note: See TracChangeset
for help on using the changeset viewer.