38 PRECONDITION(bounds.size(),
"Cannot merge empty list of bounds");
42 Bounds current = bounds.front();
43 double componentUpper = current.upper;
44 std::optional<double> resultLower;
62 for (
const auto &_bound : bounds | std::views::drop(1)) {
63 if (_bound.lower <= current.upper) {
68 current.lower = _bound.lower;
69 current.upper = std::min(current.upper, _bound.upper);
75 resultLower = current.lower;
78 current.lower = _bound.lower;
80 _bound.lower <= componentUpper
81 ? std::min(componentUpper,
88 componentUpper = std::max(componentUpper, _bound.upper);
90 return Bounds{.lower = resultLower.value_or(current.lower),
91 .upper = current.upper,
92 .aid1 = bounds.front().aid1,
93 .aid4 = bounds.front().aid4};