Changeset 8083 for branches/FitnessLandscapeAnalysis/HeuristicLab.Problems.NK/BinaryVectorComparers/LexicographicBinaryVectorComparer.cs
- Timestamp:
- 06/21/12 16:51:45 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/FitnessLandscapeAnalysis/HeuristicLab.Problems.NK/BinaryVectorComparers/LexicographicBinaryVectorComparer.cs
r7128 r8083 1 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 2 using HeuristicLab.Common; 5 3 using HeuristicLab.Core; 6 using HeuristicLab.Data; 7 using HeuristicLab.Common; 4 using HeuristicLab.Encodings.BinaryVectorEncoding; 8 5 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 9 using HeuristicLab.Encodings.BinaryVectorEncoding;10 6 11 7 namespace HeuristicLab.Problems.NK { 12 8 13 9 [Item("Lexicographic Binary Vector Comparer", "Compares two binary vectors lexicographically")] 14 10 [StorableClass] … … 16 12 17 13 [StorableConstructor] 18 pr otectedLexicographicBinaryVectorComparer(bool deserializing) : base(deserializing) { }19 pr otectedLexicographicBinaryVectorComparer(LexicographicBinaryVectorComparer original, Cloner cloner)14 private LexicographicBinaryVectorComparer(bool deserializing) : base(deserializing) { } 15 private LexicographicBinaryVectorComparer(LexicographicBinaryVectorComparer original, Cloner cloner) 20 16 : base(original, cloner) { 21 17 } … … 26 22 27 23 public override int Compare(BinaryVector x, BinaryVector y) { 28 for (int i = 0; i <Math.Min(x.Length, y.Length); i++) {24 for (int i = 0; i < Math.Min(x.Length, y.Length); i++) { 29 25 if (!x[i] && y[i]) 30 26 return -1;
Note: See TracChangeset
for help on using the changeset viewer.