File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -201,8 +201,10 @@ void TesseractDecoder::decode_to_errors(const std::vector<uint64_t>& detections)
201201 }
202202
203203 if (config.beam_climbing ) {
204- for (int beam = config.det_beam ; beam >= 0 ; --beam) {
205- size_t detector_order = beam % config.det_orders .size ();
204+ int beam = 0 ;
205+ int detector_order = 0 ;
206+ for (int trial = 0 ; trial < std::max (config.det_beam + 1 , int (config.det_orders .size ()));
207+ ++trial) {
206208 decode_to_errors (detections, detector_order, beam);
207209 double local_cost = cost_from_errors (predicted_errors_buffer);
208210 if (!low_confidence_flag && local_cost < best_cost) {
@@ -215,6 +217,10 @@ void TesseractDecoder::decode_to_errors(const std::vector<uint64_t>& detections)
215217 << " and obs_mask " << get_flipped_observables (predicted_errors_buffer)
216218 << " . Best cost so far: " << best_cost << std::endl;
217219 }
220+ beam += 1 ;
221+ detector_order += 1 ;
222+ beam %= (config.det_beam + 1 );
223+ detector_order %= config.det_orders .size ();
218224 }
219225 } else {
220226 for (size_t detector_order = 0 ; detector_order < config.det_orders .size (); ++detector_order) {
You can’t perform that action at this time.
0 commit comments