overlapping contains all Regions that overlap with their field at <level> temp contains all other Regions
45 {
46
48
50
51
52
53
54
55
59 f.set_ored_field(
f.field());
60 }
61 return;
62 }
63
65
67
78 overlapping.reserve(
mr.size());
79 orig.reserve(
mr.size());
80 temp.reserve(
mr.size());
81 for (;; ) {
83 break;
84 }
85 overlapping.clear();
86 temp.clear();
87
89 for (k = 0;
k <
mr.size(); ++
k) {
90 reference_region =
mr[
k];
93 overlapping.push_back(reference_region);
94 break;
95 } else {
96 temp.push_back(reference_region);
97 }
98 }
99 }
100
101
102 if (reference_region == 0) break;
103 if (overlapping.empty()) {
104 break;
105 }
106
110
111
112 for (;
k <
mr.size(); ++
k) {
114 temp.push_back(region);
115 }
116 bool found_overlap = false;
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133 do {
134
135 orig.clear();
136 orig = temp;
137 temp.clear();
138 found_overlap = false;
139 for (
size_t i = 0;
i < orig.size(); ++
i) {
142 bool overlap = false;
145
146
147 if (
f1.range()->field_name() ==
f.range()->field_name()) overlap = ored_field.
overlaps_with(thisField);
148
149
150 if (overlap || (region->
group_name() == group)) {
151 overlapping.push_back(region);
152 ored_field |= thisField;
153 found_overlap = true;
154 } else {
155 temp.push_back(region);
156 }
157 }
158 } while (found_overlap);
159
160
161
162
163 bool all_within_group = true;
164 bool none_within_group = true;
165 for (
size_t i = 0;
i < overlapping.size(); ++
i) {
168 none_within_group = false;
169 } else {
170 all_within_group = false;
171 }
172 }
173
174 if (all_within_group) temp.clear();
175
176
177
178
179 if (!none_within_group) {
180 get_bits(overlapping, level + 1, group);
181 }
182
184 }
185 }
void get_bits(const RV ®ions, size_t level, const std::string &group)
static const std::vector< std::string > regions
IdDictFieldImplementation is used to capture the specification of a single field of an Identifier.
virtual std::string group_name() const override
const IdDictFieldImplementation & implementation(size_t i) const
size_t n_implementation() const
bool overlaps_with(const IdentifierField &other) const
Check whether two IdentifierFields overlap (Are there any values which satisfy the constraints of bot...
std::vector< IdDictRegion * > RV
void compute_bits(const RV ®ions, size_t level, const std::string &group)
Compute the OR of all fields at <level>, for the subset of overlapping regions.