54 if (!helper_.SynchronizeAndSetDirection())
return false;
56 mandatory_regions_.clear();
57 mandatory_regions_index_.clear();
58 bool has_zero_area_boxes =
false;
59 absl::Span<const TaskTime> tasks =
60 helper_.x_helper().TaskByIncreasingNegatedStartMax();
61 for (
int i = tasks.size(); --
i >= 0;) {
62 const int b = tasks[
i].task_index;
63 if (!helper_.IsPresent(
b))
continue;
65 const IntegerValue x_start_max = helper_.x_helper().StartMax(
b);
66 const IntegerValue x_end_min = helper_.x_helper().EndMin(
b);
67 if (x_start_max > x_end_min)
continue;
69 const IntegerValue y_start_max = helper_.y_helper().StartMax(
b);
70 const IntegerValue y_end_min = helper_.y_helper().EndMin(
b);
71 if (y_start_max > y_end_min)
continue;
73 mandatory_regions_.push_back({.x_min = x_start_max,
77 mandatory_regions_index_.push_back(
b);
79 if (mandatory_regions_.back().SizeX() == 0 ||
80 mandatory_regions_.back().SizeY() == 0) {
81 has_zero_area_boxes =
true;
84 std::optional<std::pair<int, int>> conflict;
85 if (has_zero_area_boxes) {
86 num_calls_zero_area_++;
89 num_calls_nonzero_area_++;
93 if (conflict.has_value()) {
95 return helper_.ReportConflictFromTwoBoxes(
96 mandatory_regions_index_[conflict->first],
97 mandatory_regions_index_[conflict->second]);