149 PRECONDITION(bounds.size(),
"Cannot merge empty list of bounds");
153 Bounds current = bounds.front();
154 double componentUpper = current.upper;
155 std::optional<double> resultLower;
173 for (
const auto &_bound : bounds | std::views::drop(1)) {
174 if (_bound.lower <= current.upper) {
179 current.lower = _bound.lower;
180 current.upper = std::min(current.upper, _bound.upper);
186 resultLower = current.lower;
189 current.lower = _bound.lower;
191 _bound.lower <= componentUpper
192 ? std::min(componentUpper,
199 componentUpper = std::max(componentUpper, _bound.upper);
201 return Bounds{.lower = resultLower.value_or(current.lower),
202 .upper = current.upper,
203 .aid1 = bounds.front().aid1,
204 .aid4 = bounds.front().aid4};