Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/08/22 17:36:18 (3 years ago)
Author:
pfleck
Message:

#3040 Added first version of sampling segment optimization manipulator for vectorial sym reg.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeVectorInterpreter.cs

    r18060 r18214  
    729729        case OpCodes.SubVector: {
    730730          DoubleVector SubVector(DoubleVector v , double start, double end) {
    731             int Mod(int x, int m) => (x % m + m) % m;
    732             int startIdx = Mod((int)Math.Round(start * v.Count), v.Count);
    733             int endIdx = Mod((int)Math.Round(end * v.Count), v.Count);
    734               int size = v.Count;
     731            int size = v.Count;
     732            int startIdx = Math.Abs((int)Math.Round(start * (size - 1)) % size);
     733            int endIdx = Math.Abs((int)Math.Round(end * (size - 1)) % size);
    735734            if (startIdx < endIdx) {
    736735              return v.SubVector(startIdx, count: endIdx - startIdx);
Note: See TracChangeset for help on using the changeset viewer.