Consolidate IPOPT solver implementations
We have two implementations of the ipopt solver, IPOPTSolver
and IPOPTSolverLean
. I would like to get rid of the redundancy and decide for one (merged) version that we will maintain from here on. This is because I want to add the possibility to add a custom intermediate_callback functor to the interface and I do not want to add this in several classes redundantly. Also both classes contain some copy'n'paste repeated code already, which I would like to clean up while at it.
There are a few differences I can see with IPOPTSolverLean
- uses pimpl idiom for the implementation
- uses DEB_* macros for logging
- wraps access to ipopt options with its own get/setters, and caches the state to pass it on to ipopt later
- moved the check wether the optimization found a solution to the
check_ipopt_status
Regarding the pimpl implementation, I would advocate against using it in this case. It makes the implementation more complicated for a negligible benefit regarding decoupling and compilation times (for this particular class).
The DEB_* macros for debugging make sense I suppose, although I don't like the use of macros that seems to be the default mechanism for logging in CoMISo (true?) so I guess we should stick with that.
Wrapping access to the IPOPT options via get/setters I guess can be done, however there's a ton of solver options that I have already used, and adding a wrapper for each of them seems to incur a lot of overhead for a questionable benefit. I found it very convenient, using the IPOPTSolver
to be able to just pass options directly to ipopt without going through the interface.
The last point makes sense of course since it reduces code replication.