Skip to content

Commit eff2a15

Browse files
Minor changes
Signed-off-by: Dragana Grbic <draganaurosgrbic@gmail.com>
1 parent 779e7ac commit eff2a15

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

src/tesseract.cc

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ double TesseractDecoder::get_detcost(size_t d, const std::vector<DetectorCostTup
8080
for (size_t ei : d2e[d]) {
8181
ec = error_costs[ei];
8282
dct = detector_cost_tuples[ei];
83-
//if (ec.min_cost >= min_cost) break;
83+
if (ec.min_cost >= min_cost) break;
8484
if (!dct.error_blocked) {
8585
double error_cost = ec.likelihood_cost / dct.detectors_count;
8686
min_cost = std::min(min_cost, error_cost);
@@ -269,6 +269,7 @@ void TesseractDecoder::decode_to_errors(const std::vector<uint64_t>& detections,
269269
std::vector<size_t> next_errors;
270270
std::vector<char> next_detectors;
271271
std::vector<DetectorCostTuple> next_detector_cost_tuples;
272+
std::vector<DetectorCostTuple> next_next_detector_cost_tuples;
272273

273274
pq.push({initial_cost, min_num_detectors, std::vector<size_t>()});
274275
size_t num_pq_pushed = 1;
@@ -390,7 +391,7 @@ void TesseractDecoder::decode_to_errors(const std::vector<uint64_t>& detections,
390391
size_t next_num_detectors = node.num_detectors;
391392

392393
if (config.at_most_two_errors_per_detector) {
393-
// next_next_blocked_errs = next_blocked_errs;
394+
next_next_detector_cost_tuples = next_detector_cost_tuples;
394395
}
395396

396397
for (int d : edets[ei]) {
@@ -403,7 +404,7 @@ void TesseractDecoder::decode_to_errors(const std::vector<uint64_t>& detections,
403404

404405
if (!next_detectors[d] && config.at_most_two_errors_per_detector) {
405406
for (size_t oei : d2e[d]) {
406-
// next_next_blocked_errs[oei] = true;
407+
next_next_detector_cost_tuples[oei].error_blocked = true;
407408
}
408409
}
409410
}
@@ -421,8 +422,7 @@ void TesseractDecoder::decode_to_errors(const std::vector<uint64_t>& detections,
421422
}
422423
next_cost -= detector_cost_cache[d];
423424
} else {
424-
// next_cost += get_detcost(d, config.at_most_two_errors_per_detector ? next_next_blocked_errs : next_blocked_errs, next_det_counts);
425-
next_cost += get_detcost(d, next_detector_cost_tuples);
425+
next_cost += get_detcost(d, config.at_most_two_errors_per_detector ? next_next_detector_cost_tuples : next_detector_cost_tuples);
426426
}
427427
}
428428

@@ -432,8 +432,7 @@ void TesseractDecoder::decode_to_errors(const std::vector<uint64_t>& detections,
432432
detector_cost_cache[od] = get_detcost(od, detector_cost_tuples);
433433
}
434434
next_cost -= detector_cost_cache[od];
435-
// next_cost += get_detcost(od, config.at_most_two_errors_per_detector ? next_next_blocked_errs : next_blocked_errs, next_det_counts);
436-
next_cost += get_detcost(od, next_detector_cost_tuples);
435+
next_cost += get_detcost(od, config.at_most_two_errors_per_detector ? next_next_detector_cost_tuples : next_detector_cost_tuples);
437436
}
438437

439438
if (next_cost == INF) continue;

0 commit comments

Comments
 (0)