QuadProgpp icon indicating copy to clipboard operation
QuadProgpp copied to clipboard

getting wrong result

Open MichealYu567 opened this issue 7 years ago • 2 comments

some times i get the wrong result with quadprog++. to be specific, the result doesn't satisfy the inequality constraints.

through debug, i found that the reason may be as bellows: the checking code(line 246-250):

if (fabs(psi) <= m * std::numeric_limits::epsilon() * c1 * c2* 100.0) { /* numerically there are not infeasibilities anymore */ return f_value; }

when I got a matrix G whose c1c2 is very large, after add equality constraints, first run to the checking code, psi = -70, as c1c2 is very large, it directly returns the f_value. but the result doesn't satisfy the inequality constraints.

My question is why use "m * std::numeric_limits::epsilon() * c1 * c2* 100.0" as the threshold, instead of "m * std::numeric_limits::epsilon()". In fact, we just want to check whether CI[i]*X < 0 or not.

i add my data here, in case you want to debug it. input data.zip

MichealYu567 avatar Oct 09 '18 09:10 MichealYu567

I think I have run into the same problem here where the solver returns an incorrect solution that disregards inequality constraints when there are equality constraints. Not sure what caused it.

AlanSixth avatar Apr 10 '19 12:04 AlanSixth

I am having the same problem, the solution doesn't respect the inequality constraints. Anyone solved this bug?

alp66alp66 avatar Sep 21 '21 21:09 alp66alp66