Commit 1f7c0334 authored by Chuanren Wu's avatar Chuanren Wu

enable failed test

parent 7dd2fc29
......@@ -67,24 +67,27 @@ std::vector<int> discretizeImpl(
std::vector<int> minRes(vl.size());
std::transform(vl.begin(), vl.end(), minRes.begin(), atLeast1<double>);
// sort(vc) before the iterations?
#ifndef NDEBUG
long iterations = 0;
#endif
auto res = minRes;
bool trigger = true;
while (trigger) {
while (trigger && iterations < 100) {
trigger = false;
for (const auto &c : vc) {
if (validate(c, minRes, vl, res)) {
trigger = true;
}
}
#ifndef NDEBUG
++iterations;
#endif
}
if (iterations == 100) {
#ifndef NDEBUG
std::cout << "max iteration number reached, problem maybe unsolvable\n";
#endif
return std::vector<int>();
} else {
#ifndef NDEBUG
std::cout << iterations << " iterations used\n";
#endif
return res;
}
}
......@@ -397,7 +397,6 @@ TEST(BC, Loop2)
EXPECT_LE(10, v[3]);
}
#if 0
TEST(BC, LoopFailed1)
{
std::vector<Constraint> cs;
......@@ -427,8 +426,6 @@ TEST(BC, LoopFailed1)
auto v = discretize(vl, cs);
EXPECT_EQ(0, v.size());
}
#endif
TEST(BC, Combinations1)
{
......
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