Changeset 14662 for trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Manipulators/InversionManipulator.cs
- Timestamp:
- 02/11/17 00:27:04 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Manipulators/InversionManipulator.cs
r14185 r14662 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
Note: See TracChangeset
for help on using the changeset viewer.