Changeset 15217 for stable/HeuristicLab.Encodings.RealVectorEncoding/3.3/RealVectorEqualityComparer.cs
- Timestamp:
- 07/12/17 21:02:01 (7 years ago)
- Location:
- stable
- Files:
-
- 2 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk/sources merged: 14412,14475-14476,14659-14660,14663,14912,15050,15067,15069,15079,15162,15166,15172-15173
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Encodings.RealVectorEncoding
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Encodings.RealVectorEncoding merged: 14659-14660,15067,15162
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Encodings.RealVectorEncoding/3.3/RealVectorEqualityComparer.cs
r14660 r15217 20 20 #endregion 21 21 22 using System; 22 23 using System.Collections.Generic; 24 using HeuristicLab.PluginInfrastructure; 23 25 24 26 namespace HeuristicLab.Encodings.RealVectorEncoding { 27 [NonDiscoverableType] 25 28 public class RealVectorEqualityComparer : EqualityComparer<RealVector> { 26 29 public override bool Equals(RealVector x, RealVector y) { 27 if ( x == null && y == null) return true;30 if (ReferenceEquals(x, y)) return true; 28 31 if (x == null || y == null) return false; 29 32 if (x.Length != y.Length) return false; 30 33 for (var i = 0; i < x.Length; i++) 31 if (x[i] == y[i]) return false;34 if (x[i] != y[i]) return false; 32 35 return true; 33 36 } 34 37 35 38 public override int GetHashCode(RealVector obj) { 39 if (obj == null) throw new ArgumentNullException("obj", "RealVectorEqualityComparer: Cannot compute hash value of null."); 36 40 unchecked { 37 41 int hash = 17;
Note: See TracChangeset
for help on using the changeset viewer.