Skip to content

Commit ef26431

Browse files
committed
Adjust where we count removed pairs
1 parent ce0ec39 commit ef26431

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

HRT/4_YESBIN_2STA_NOMERGED_BOTHTIES/Allocation.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,9 @@ int Allocation::reductionMineDoctors(int mode) {
234234
int remHere = 0;
235235
#endif /* DEBUG */
236236
for (int k = worst_rank + 1; k < doctors[i].nbPref; k++) {
237+
nbTotRem += doctors[i].preferences[k].size();
238+
doctors[i].nbTotPref -= doctors[i].preferences[k].size();
237239
for (size_t id = 0; id < doctors[i].preferences[k].size(); ++id) {
238-
nbTotRem += 1;
239240
#ifdef DEBUG
240241
remHere += 1;
241242
#endif /* DEBUG */
@@ -452,11 +453,11 @@ int Allocation::reductionExactDoctor(bool supp) {
452453
int remHere = 0;
453454
#endif /* DEBUG */
454455
for (int k = rank + 1; k < doctors[i].nbPref; k++) {
455-
for (size_t id = 0; id < doctors[i].preferences[k].size(); ++id) {
456-
nbTotRem += 1;
456+
nbTotRem += doctors[i].preferences[k].size();
457457
#ifdef DEBUG
458-
remHere += 1;
458+
remHere += doctors[i].preferences[k].size();
459459
#endif /* DEBUG */
460+
for (size_t id = 0; id < doctors[i].preferences[k].size(); ++id) {
460461
int idxHos = doctors[i].preferences[k][id] - 1;
461462
// remove from idxHos any reference to i.
462463
for(size_t rank = 0 ; rank < hospitals[idxHos].preferences.size(); ++rank) {

0 commit comments

Comments
 (0)