How to move on from CVX to C code?

I have used CVX for quite a while now to build prototypes of my model. This has worked great, but now that I have finalized the problem formulation, I want to go for speed. That is why I want to move on from CVX to C (in combination with ECOS, to be precise).

My current problem is an SOCP in the form:

\text{minimize}\ f^T x

\text{subject to}\ ||A_i x + b_i|| \leq c_i^T x + d_i, i=1,2,...,m

F x = g

I now need to formulate it in this form:

\text{minimize}\ f^T x

\text{subject to}\ Ax = b,\ Gx \leq_K h

How should I approach this? Is there any reference that explains this? It would be great to get some references that could be useful for this.

Depending on how fast you need it to be you might find calling ecos directly (rather than through cvx) gives you the performance boost you need. I believe the C functions have a similar interface so even if you need the extra speed calling ecos directly from matlab will probably help you get your problem set up correctly.

The documentation on the ecos github page https://github.com/ifa-ethz/ecos is a bit minimal. Their interface is very similar to that used in the cvxopt solvers and I found that following the documentation http://cvxopt.org/userguide/coneprog.html got me most of the way there.

Out of curiosity, have you tried the ECOS shim for CVX yet? This should give you a decent idea as to the speed.

mcg, yes, I have. It worked great, and I found that ECOS works faster than other solvers. However, the bottleneck in my code remains CVX, which is I would like to take the next step and call ECOS directly.

PS: I don’t seem to be able to comment on Jeremy’s answer below. Is that only possible with a certain reputation?

That’s interesting. Sometimes I find that there is some sort of caching issue and a comment I post doesn’t appear the first couple of times I refresh. But yours didn’t show at all. I don’t know why that is.

It used to be the case that you could answer, but not comment, until you met some karma threshold. But I think that was changed (by mcg)?

That may be it. Perhaps you are always allowed to comment on your own question.

I’m actually looking at some new Q&A software. The big challenge will be importing the data over.

That’s it I guess. Could you set the karma threshold for commenting lower, mcg? I doubt it would be abused for spamming, would it?

Truth is, we’re not getting enough traction on the upvotes and answer acceptance as it is. Karma is sort of worthless if it isn’t changing. I’ll figure something out.