cvxgrp / scs

Splitting Conic Solver
MIT License
553 stars 136 forks source link

Iteration callback for early stopping #227

Open gkronber opened 2 years ago

gkronber commented 2 years ago

Specifications

Description

It would be nice to be able to stop SCS early. One way to implement this could be be passing a function pointer in the ScsSettings that is called on each iteration. This would also allow to report the progress back to the caller. Right now SCS writes directly to SCS and there is no way for the caller to monitor optimization progress.

bodono commented 2 years ago

Yes, that would be a nice feature to have. It would be relatively straightforward to add support for a callback function that takes the relevant data structs and returns a boolean for whether or not to stop, which would allow custom stopping criteria. I'm pretty swamped at the moment but I would be happy to accept a PR for this.