41 if (pain_points_heaps_[h].empty())
continue;
42 *priority = pain_points_heaps_[h].
PeekTop().
key;
44 pain_points_heaps_[h].
Pop(
nullptr);
45 return static_cast<LMPainPointsType>(h);
53 for (
int col = 0; col < ratings->
dimension(); ++col) {
55 for (
int row = col + 1; row < row_end; ++row) {
57 if (coord.
Valid(*ratings) &&
64 true, max_char_wh_ratio_, word_res);
112 float priority = ol_dif > 0 ? (vse->
ratings_sum-rat_subtr)/ol_dif : 0.0;
114 priority,
true, max_char_wh_ratio_, word_res);
115 }
else if (debug_level_ > 3) {
116 tprintf(
"NO pain point (Classified) for col=%d row=%d type=%s\n",
117 pain_coord.
col, pain_coord.
row,
121 for (b_it.mark_cycle_pt(); !b_it.cycled_list(); b_it.forward()) {
127 curr_vse = parent_vse;
128 curr_b = curr_vse->
curr_b;
137 for (
int d = 0; d < fixpt.
size(); ++d) {
150 bool ok_to_extend,
float max_char_wh_ratio,
157 if (debug_level_ > 3) {
158 tprintf(
"Generating pain point for col=%d row=%d type=%s\n",
159 col, row, LMPainPointsTypeName[pp_type]);
164 max_char_wh_ratio, word_res, debug_level_,
175 max_char_wh_ratio, word_res, debug_level_,
180 if (debug_level_ > 3) {
181 tprintf(
"Discarded pain point with a bad shape\n");
187 if (pain_points_heaps_[pp_type].size() < max_heap_size_) {
191 priority = special_priority;
193 priority = associate_stats.
gap_sum;
196 pain_points_heaps_[pp_type].
Push(&pain_point);
198 tprintf(
"Added pain point with priority %g\n", priority);
202 if (debug_level_)
tprintf(
"Pain points heap is full\n");
212 for (
auto & pain_points_heap : pain_points_heaps_) {
214 for (
int j = 0; j < heap->
size(); ++j)
215 (*heap)[j].data.MapForSplit(index);