Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/07/22 15:45:30 (3 years ago)
Author:
pfleck
Message:

#3040 Changed SubVector symbol to include end-index in result.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SegmentOptimization/SegmentOptimizationProblem.cs

    r18217 r18230  
    173173    }
    174174
    175     private static double BoundedAggregation(DoubleArray data, IntRange bounds, Aggregation aggregation) {
    176       var matrix = new DoubleMatrix(1, data.Length);
    177       for (int i = 0; i < data.Length; i++) matrix[0, i] = data[i];
    178       return BoundedAggregation(matrix, bounds, aggregation);
    179     }
     175    //private static double BoundedAggregation(DoubleArray data, IntRange bounds, Aggregation aggregation) {
     176    //  var matrix = new DoubleMatrix(1, data.Length);
     177    //  for (int i = 0; i < data.Length; i++) matrix[0, i] = data[i];
     178    //  return BoundedAggregation(matrix, bounds, aggregation);
     179    //}
    180180
    181181    private static double BoundedAggregation(DoubleMatrix data, IntRange bounds, Aggregation aggregation) {
    182       if (bounds.Size == 0) {
    183         return 0;
    184       }
     182      //if (bounds.Size == 0) {
     183      //  return 0;
     184      //}
    185185
    186186      var resultValues = new double[data.Rows];
    187187      for (int row = 0; row < data.Rows; row++) {
    188188        var vector = data.GetRow(row);
    189         var segment = vector.Skip(bounds.Start).Take(bounds.Size);
     189        var segment = vector.Skip(bounds.Start).Take(bounds.Size + 1); // exclusive end
    190190        switch (aggregation) {
    191191          case Aggregation.Sum:
Note: See TracChangeset for help on using the changeset viewer.