Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
MacroUniverse committed Aug 15, 2022
1 parent 2c893ab commit a9aac6e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion SLISC/hungarian.h
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ inline Long hungarian(vvecLong_I original, bool allow_negatives = true)
Long path_row_0, path_col_0; //temporary to hold the smallest uncovered value

// Array for the augmenting path algorithm
vvecLong path(sz+1, vecLong(2, 0));
vvecLong path(2*sz, vecLong(2, 0));

/* Now Work The Steps */
bool done = false;
Expand Down
8 changes: 3 additions & 5 deletions test/test_hungarian.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,11 @@ void test_hungarian() //example of usage
{40,60,35},
{20,40,25}}); res.push_back(95);

// ====== failed!!!!!!!!! ===============
// tests.push_back({{15,40,45},
// {20,60,35},
// {20,40,25}}); res.push_back(85);
tests.push_back({{15,40,45},
{20,60,35},
{20,40,25}}); res.push_back(85);

for (Long i = 0; i < (Long)tests.size(); ++i) {
// cout << " =========== " << i << " =========== " << endl;
SLS_ASSERT(hungarian(tests[i]) == res[i]);
}
}

0 comments on commit a9aac6e

Please sign in to comment.