jaxopt
jaxopt copied to clipboard
OSQP should inherit from IterativeSolver
This way, we can use the update method with it.
It is certainly possible, but what is the advantage of doing so compared to just using BoxOSQP instead ?
I'm afraid that the fix is not straighforwarsd since it may break consistency of the API or induce a runtime cost.
In jaxopt, typically, the params tuple expected by update() has the same signature as the one expected by run() or returned by init_params. Here, however the run of OSQP delegates to BoxOSQP, which has a different signature. So, either the OSQP.update() method would have a different signature by delegating the call to BoxOSQP.update (unexpected and inconsistent), either it performs the translation between the two problems formulations back and forth at each iteration (thanks to OSQP_to_BoxOSQP object), in which case it might be expensive (even though it is not the bottleneck).