Commit e4ed4f8a authored by Chuanren Wu's avatar Chuanren Wu

pass the new test

parent c5175b7e
......@@ -29,7 +29,7 @@ static void redist(
[&vl](double s, int i){ return s+vl[i]; } );
int rest = n;
std::for_each(std::next(s.cbegin()), s.cend(), [&](int i){
res[i] = std::max(minRes[i], atLeast1(vl[i]*factor*n));
res[i] = std::max(minRes[i], atLeast1(std::ceil(vl[i]*factor*n)));
rest -= res[i];
});
const int idFirst = *s.cbegin();
......
......@@ -86,8 +86,7 @@ TEST(BC, SingleSegment1)
TEST(BC, HomogeneousLine)
{
std::vector<Constraint> cs;
{
{
Constraint c;
for (int i = 1; i <= 10; ++i) {
c.plus(i);
......@@ -103,7 +102,7 @@ TEST(BC, HomogeneousLine)
auto v = discretize(vl, cs);
ASSERT_NE(0, v.size());
for (int i = 1; i <= 10; ++i) {
EXPECT_LE(2, v[i]);
EXPECT_GE(2, v[i]);
}
}
......
Markdown is supported
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