- Timestamp:
- 01/11/17 01:53:44 (8 years ago)
- Location:
- branches/MemPRAlgorithm/HeuristicLab.Encodings.PermutationEncoding/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/MemPRAlgorithm/HeuristicLab.Encodings.PermutationEncoding/3.3/Manipulators/InversionManipulator.cs
r14185 r14556 60 60 61 61 public static void Apply(Permutation permutation, int breakPoint1, int breakPoint2) { 62 for (int i = 0; i <= (breakPoint2 - breakPoint1) / 2; i++) { // invert permutation between breakpoints 63 int temp = permutation[breakPoint1 + i]; 64 permutation[breakPoint1 + i] = permutation[breakPoint2 - i]; 65 permutation[breakPoint2 - i] = temp; 66 } 62 permutation.Reverse(breakPoint1, breakPoint2 - breakPoint1 + 1); 67 63 } 68 64 -
branches/MemPRAlgorithm/HeuristicLab.Encodings.PermutationEncoding/3.3/Permutation.cs
r14185 r14556 121 121 } 122 122 123 public virtual void Reverse(int startIndex, int length) { 124 Array.Reverse(array, startIndex, length); 125 } 126 123 127 public event EventHandler PermutationTypeChanged; 124 128
Note: See TracChangeset
for help on using the changeset viewer.