Free cookie consent management tool by TermsFeed Policy Generator

Changeset 12674


Ignore:
Timestamp:
07/08/15 11:02:22 (9 years ago)
Author:
gkronber
Message:

#2359: use stable sort in pruning analyzer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisSingleObjectivePruningAnalyzer.cs

    r12361 r12674  
    206206      var qualities = Quality.Select(x => x.Value).ToArray();
    207207      var indices = Enumerable.Range(0, qualities.Length).ToArray();
    208       Array.Sort(qualities, indices);
     208      indices.StableSort((a, b) => qualities[a].CompareTo(qualities[b]));
     209
    209210      if (!Maximization.Value) Array.Reverse(indices);
    210211
     
    214215      var empty = new EmptyOperator();
    215216
    216       for (int i = 0; i < subscopes.Count; ++i) {
     217      for (int i = 0; i < indices.Length; ++i) {
    217218        IOperator @operator;
    218219        if (range.Start <= i && i < range.End && random.NextDouble() <= PruningProbability)
Note: See TracChangeset for help on using the changeset viewer.