roboptim / roboptim-shared-tests

RobOptim Shared Tests (to be used as a Git submodule)
1 stars 8 forks source link

Factorize code for tests. #7

Closed bchretien closed 10 years ago

bchretien commented 10 years ago

cc @thomas-moulard

Several solvers (e.g. NLopt) can find the expected solution while giving a warning (e.g. the reason why the solver stopped). I thought that since all that matters is the result, I added support for SOLVER_VALUE_WARNINGS and factorized things a bit. Tolerances for f0, x and f have to be set at the beginning of the test function.

I also added BOOST_CHECK_SMALL_OR_CLOSE because I had a test failing when the solver returned 1e-26 and 0. was expected. I based it on this SO question, but it is certainly improvable.

thomas-moulard commented 10 years ago

Thanks, good for me! Note that we can probable factor tests even more but so far I still think this is good enough.

Also, we may want to integrate at some points set of parameters for all solvers just to relax the stopping criterion.

bchretien commented 10 years ago

:+1: for solver parameters, although this is the usual problem with NLP solvers: how should I tweak my parameters? This is something that could be determined (or at least tested and evaluated) while doing solver benchmarking for RobOptim.

thomas-moulard commented 10 years ago

Well, for test case what we desire more is having a consistent behavior of all solvers, for instance they all satisfy equality constraints with a particular precision. It would make things more fair to have all the solver use the same constant. Then this constant could be propagated in relevant tests. Same things for stopping criteria for instance. This is what I was thinking of. Then, tuning to make the optimization faster is another problem.