Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make error codes consistent with e.g qpOASES #4

Open
mvukov opened this issue Aug 5, 2014 · 4 comments
Open

Make error codes consistent with e.g qpOASES #4

mvukov opened this issue Aug 5, 2014 · 4 comments

Comments

@mvukov
Copy link
Contributor

mvukov commented Aug 5, 2014

It would be much easier to switch between the solvers if the error codes are similar. At least for "OK"-like return codes. In particular, is there really a need that QPDUNES_OK and QPDUNES_SUCC_OPTIMAL_SOLUTION_FOUND have different values? Moreover, @jfrasch, is there really a need for the later one??

@jfrasch
Copy link
Owner

jfrasch commented Aug 5, 2014

I agree, that it would be easier for quite adding of the solver, but in general it is quite dangerous if return codes are not checked and converted to the caller's native syntax in the calling interface. Once you do these checks you will have to do it differently for each solver anyways, I fear.

Regarding QPDUNES_OK and QPDUNES_SUCC_OPTIMAL_SOLUTION_FOUND: qpDUNES-internally, these are two completely different meanings, the former one declaring that something worked as intended, the latter one indicating that some component detected optimality, and the algorithm may stop and return the result without much further ado.

From an outside point of view QPDUNES_SUCC_OPTIMAL_SOLUTION_FOUND is needed in my opinion to differentiate between a termination of the solver due to detection of an optimality certificate and a termination of the solver due to time or iteration limit (not in this version yet, but to come), for example.

@mvukov
Copy link
Contributor Author

mvukov commented Aug 5, 2014

I always check for return codes. My main objection was that "OK" like return codes could be the same: 0.

the latter one indicating that some component detected optimality, and the algorithm may stop and return the result without much further ado.

This is still an "OK" situation, no? Solver returning simple "OK" can mean "hey, I found an optimal solution"? 😄

Hitting time or iteration constraint are exceptions and I agree they should return something else than pure "OK".

@ferreau
Copy link
Collaborator

ferreau commented Aug 5, 2014

I also strongly suggest to have a simple set of return values for "naive" users. qpOASES uses the following ones:

  • optimal solution found
  • max iterations reached
  • internal error
  • QP infeasible
  • QP unbounded

which is all a typical user needs to know. Btw, the C++ core of qpOASES also throws more sophisticated error messages, but the user can easily convert them to the ones mentioned above by calling "getSimpleStatus". I found that I good compromise.

@mvukov
Copy link
Contributor Author

mvukov commented Aug 5, 2014

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants