Changeset 12129 for trunk/sources/HeuristicLab.Optimization.Operators/3.3/SolutionSimilarityCalculator.cs
- Timestamp:
- 03/04/15 16:36:40 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Optimization.Operators/3.3/SolutionSimilarityCalculator.cs
r12126 r12129 146 146 var da2 = q2 as DoubleArray; 147 147 148 if (da1 != null && da2 != null) 149 return !da1.Zip(da2, Tuple.Create).Any(x => !x.Item1.IsAlmost(x.Item2)); 148 if (da1 != null && da2 != null) { 149 if (da1.Length != da2.Length) 150 throw new ArgumentException("The quality arrays must have the same length."); 151 152 for (int i = 0; i < da1.Length; ++i) { 153 if (!da1[i].IsAlmost(da2[i])) 154 return false; 155 } 156 157 return true; 158 } 150 159 151 160 throw new ArgumentException("Could not determine quality equality.");
Note: See TracChangeset
for help on using the changeset viewer.