| 184 | }; |
| 185 | |
| 186 | static SweepSummary computeSummary(const fl::vector<SweepPoint> &points, |
| 187 | bool inBandOnly) { |
| 188 | SweepSummary s = {}; |
| 189 | s.minConcentration = 1.0f; |
| 190 | float concSum = 0.0f; |
| 191 | |
| 192 | for (int i = 0; i < static_cast<int>(points.size()); i++) { |
| 193 | const SweepPoint &pt = points[i]; |
| 194 | if (inBandOnly && !pt.inBand) |
| 195 | continue; |
| 196 | if (!inBandOnly && pt.inBand) |
| 197 | continue; |
| 198 | |
| 199 | s.totalSteps++; |
| 200 | if (pt.aliased) |
| 201 | s.aliasingEvents++; |
| 202 | if (!pt.monotonic && i > 0) |
| 203 | s.nonMonotonicEvents++; |
| 204 | if (pt.concentration < s.minConcentration) |
| 205 | s.minConcentration = pt.concentration; |
| 206 | concSum += pt.concentration; |
| 207 | } |
| 208 | if (s.totalSteps > 0) |
| 209 | s.avgConcentration = concSum / static_cast<float>(s.totalSteps); |
| 210 | return s; |
| 211 | } |
| 212 | |
| 213 | // --------------------------------------------------------------------------- |
| 214 | // JSON output |
no test coverage detected