diff --git a/assign/score.cc b/assign/score.cc index 61b422df841ed838a3c85ba1ca73cc334449d0ef..870963a4cfa05c91969f80b56b37daf4382a3896 100644 --- a/assign/score.cc +++ b/assign/score.cc @@ -955,6 +955,13 @@ int add_node(vvertex vv,pvertex pv, bool deterministic, bool is_fixed) } resolutions[resolution_index].switches.push_front(*switch_it); resolution_index++; + if (resolution_index <= resolutions.size()) { + if (resolutions.capacity() > resolutions.size()) { + resolutions.resize(resolutions.capacity()); + } else { + resolutions.resize(resolutions.size() * 2); + } + } total_weight += LINK_RESOLVE_INTRASWITCH; SDEBUG(cerr << " intraswitch " << first << " and " << second << endl); } @@ -1028,6 +1035,13 @@ int add_node(vvertex vv,pvertex pv, bool deterministic, bool is_fixed) } } resolution_index++; + if (resolution_index <= resolutions.size()) { + if (resolutions.capacity() > resolutions.size()) { + resolutions.resize(resolutions.capacity()); + } else { + resolutions.resize(resolutions.size() * 2); + } + } total_weight += LINK_RESOLVE_INTERSWITCH; SDEBUG(cerr << " interswitch " << get(pvertex_pmap,*source_switch_it)->name << " and " <<