diff --git a/src/include/client.h b/src/include/client.h index 7033d52..290503e 100644 --- a/src/include/client.h +++ b/src/include/client.h @@ -228,7 +228,7 @@ std::vector > GenerateEquations() { */ const double eps = 1e-6; const int error_status_of_nearint = -0x3f3f3f3f; -inline int nearint(double v) { +inline int NearbyInt(double v) { int raw = v + 0.5; if (abs(v - raw) < eps) return raw; @@ -277,15 +277,22 @@ void InterpretResult(std::vector > equations) { // std::cout << "equations[" << i << "]:" << std::endl; int number_of_1 = 0, number_of_non1 = 0, vid = -1; for (int j = 0; j < m - 1; j++) - if (nearbyint(equations[i][j]) == 1) { + if (NearbyInt(equations[i][j]) == 1) { number_of_1++; vid = j; - } else if (nearbyint(equations[i][j]) != 0) + } else if (NearbyInt(equations[i][j]) != 0) number_of_non1++; if (number_of_non1) continue; if (number_of_1 != 1) continue; - int sol = nearbyint(equations[i][m - 1]); + int sol = NearbyInt(equations[i][m - 1]); if (sol == error_status_of_nearint) continue; + if(sol!=0&&sol!=1) + { + std::cerr<<"sol="<