rugnux: the whole-spot-list rung does not overflow the cloud's reserve

The rung that reads every spot of a frame passes SIZE_MAX as the per-image cap, and the
accumulated cloud reserved max_spots_per_image * images - which overflows and throws
length_error out of vector::reserve, killing the run. The count held is already tracked
exactly, so reserve that.
This commit is contained in:
leonarski_f committed 2026-09-13 07:36:48 +02:00
1 parent 1b28dd2072
commit de839021dc
1 file changed
+2 -2
@@ -131,7 +131,7 @@ void RotationIndexer::RunIndexing() {
return;
std::vector<Coord> coords;
coords.reserve(max_spots_per_image * v_.size());
coords.reserve(accumulated_spots); // the exact count held; the per-image cap may be SIZE_MAX
for (int i = 0; i < v_.size(); i++) {
const float angle_deg = angle_deg_[i].value_or(axis_->GetAngle_deg(i) + axis_->GetWedge_deg() / 2.0f);
@@ -173,7 +173,7 @@ void RotationIndexer::RunIndexing() {
// Re-accumulate the reciprocal spots under a refined geometry/axis, to score a refined cell.
auto accumulate = [&](const DiffractionGeometry &g, const std::optional<GoniometerAxis> &ax) {
std::vector<Coord> c;
c.reserve(max_spots_per_image * v_.size());
c.reserve(accumulated_spots);
for (int i = 0; i < v_.size(); i++) {
const float a = angle_deg_[i].value_or(ax->GetAngle_deg(i) + ax->GetWedge_deg() / 2.0f);
const auto rot = ax->GetTransformationAngle(a);