Commit b56963c2 authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

multilevel.hh: enforce B_min/B_max bounds

This fixes issue #725
parent a0399483
Pipeline #937 passed with stage
in 54 minutes and 6 seconds
......@@ -727,6 +727,7 @@ struct Multilevel: public State
if (_verbose)
cout << "staging multilevel, N = " << N << endl;
size_t B_init = rs.size();
size_t B_max = State::_global_moves ? std::min(N, _B_max) : std::min(N, State::_M);
size_t B_min = State::_global_moves ? std::max(size_t(1), _B_min) : 1;
......@@ -1112,6 +1113,12 @@ struct Multilevel: public State
assert(rs.size() == B);
if (B_min > B_init || B_max < B_init)
{
S = -numeric_limits<double>::infinity();
lp = 0;
}
return {S, lp};
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment