Changeset 18230 for branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SegmentOptimization/SegmentOptimizationProblem.cs
- Timestamp:
- 03/07/22 15:45:30 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SegmentOptimization/SegmentOptimizationProblem.cs
r18217 r18230 173 173 } 174 174 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 //} 180 180 181 181 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 //} 185 185 186 186 var resultValues = new double[data.Rows]; 187 187 for (int row = 0; row < data.Rows; row++) { 188 188 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 190 190 switch (aggregation) { 191 191 case Aggregation.Sum:
Note: See TracChangeset
for help on using the changeset viewer.