Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/11/17 01:53:44 (8 years ago)
Author:
abeham
Message:

#2701:

  • fixed bug with breeding
  • fixed permutation sub-space hillclimber
  • improved speed of inversion by calling Array.Reverse(int, int) instead of using a for-loop
  • added delinking for relative-undirected permutations
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/MemPRAlgorithm/HeuristicLab.Encodings.PermutationEncoding/3.3/Manipulators/InversionManipulator.cs

    r14185 r14556  
    6060
    6161    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);
    6763    }
    6864
Note: See TracChangeset for help on using the changeset viewer.