54 if (!helper_.IsEnforced())
return true;
55 if (!helper_.SynchronizeAndSetDirection())
return false;
57 mandatory_regions_.clear();
58 mandatory_regions_index_.clear();
59 bool has_zero_area_boxes =
false;
60 absl::Span<const TaskTime> tasks =
61 helper_.x_helper().TaskByIncreasingNegatedStartMax();
62 for (
int i = tasks.size(); --
i >= 0;) {
63 const int b = tasks[
i].task_index;
64 if (!helper_.IsPresent(
b))
continue;
66 const IntegerValue x_start_max = helper_.x_helper().StartMax(
b);
67 const IntegerValue x_end_min = helper_.x_helper().EndMin(
b);
68 if (x_start_max > x_end_min)
continue;
70 const IntegerValue y_start_max = helper_.y_helper().StartMax(
b);
71 const IntegerValue y_end_min = helper_.y_helper().EndMin(
b);
72 if (y_start_max > y_end_min)
continue;
74 mandatory_regions_.push_back({.x_min = x_start_max,
78 mandatory_regions_index_.push_back(
b);
80 if (mandatory_regions_.back().SizeX() == 0 ||
81 mandatory_regions_.back().SizeY() == 0) {
82 has_zero_area_boxes =
true;
85 std::optional<std::pair<int, int>> conflict;
86 if (has_zero_area_boxes) {
87 num_calls_zero_area_++;
90 num_calls_nonzero_area_++;
94 if (conflict.has_value()) {
96 return helper_.ReportConflictFromTwoBoxes(
97 mandatory_regions_index_[conflict->first],
98 mandatory_regions_index_[conflict->second]);