Changeset 18214 for branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter
- Timestamp:
- 02/08/22 17:36:18 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeVectorInterpreter.cs
r18060 r18214 729 729 case OpCodes.SubVector: { 730 730 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); 735 734 if (startIdx < endIdx) { 736 735 return v.SubVector(startIdx, count: endIdx - startIdx);
Note: See TracChangeset
for help on using the changeset viewer.