ifa-ethz/ecos — pull request #82 by mcg1969 (2014-09-23 21:33:17+00:00)
Title: Add support for Ctrl-C

Here's my first attempt to add support for interrupting the computation with SIGINT (Ctrl-C). I have support for Unix/Mac, Windows, and MATLAB here, but I have to be honest: I've only tested Matlab at this point. However, as you can see, the code is designed in such a manner that ecos.c only sees a portable signal handler.

A SIGINT interruption is handled by the same code than handles running out of iterations---that is, it returns the best solution seen so far. A new return code ECOS_SIGINT has been created to differentiate it from ECOS_MAXIT.

I had to hack the Makefile to set CTRLC=1. That's probably not what you want to do. Frankly, I think this should be in there by default.