Here is a wish list item, for which I will not be surprised if the answer is no, because perhaps it runs so counter to deeply ingrained ways of how CVX works under the hood, and therefore would require a complete re-do of most of CVX, nevertheless, I shall go ahead and suggest. As preface, I really like the CVX interface (leveraging on MATLAB) for the problem classes it allows, and find it much nicer than GAMS/AMPL/AIMMS and native interfaces to such solvers as BARON, and it is very nice to easily express conic and semidefinite constraints and objectives, with CVX doing the tedious, difficult, and error prone work/conversions under the hood so I don’t have to.

Let’s say I specify a model in CVX resulting in a nice convex constraint set, and perhaps I even get a convex objective. That would be fine if I wanted to minimize, but what if I wanted to maximize (or possibly both, on separate invocations so as to bound the possible range of the objective function subject to constraints)? I can do the minimize the convex function part in CVX, but then I am thrown completely into the wind to fend for myself on the non-convex variant (concave or indefinite programming), or perhaps due to some minor CVX ruleset non-compliance for what in reality is a convex problem formulation. What if CVX could interface into a non-convex solver, such as a global optimizer, for example BARON (which I believe used to support SDPs, but no longer does), or a local optimization solver (not guaranteed to find global optimum)? Ability to specify starting values would be nice for non-convex solvers and necessary for some, and adding that sounds simple enough to my innocent self, blissfully ignorant of all the under the hood doings in CVX. Of course, there might be compatibility issues with certain solvers, such as whether semidefinite constraints are supported. Perhaps a DCP or CVX ruleset relaxation flag could be be turned on at some point in a session - this would relax CVX’s normal rules to some more relaxed set, although I don’t know how relaxed, and then the model could not be sent to certain solvers.

I am prepared to accept a response that the suggestion is infeasible, violating fundamental tenets as to how CVX works, but perhaps certain limited relaxations could be allowed which would provide some benefit. Addition of integer constraints is already an example of limited allowed departure from convex program formulation, even though it was not originally supported. At a minimum, allowing semidefinite and conic constraints to be passed on to a solver in a nice enough way (not sure how well that can be done if solver doesn’t natively support, but should be better than Joe/Jane NotVeryDefinite-Pack trying to kluge it him/herself), and then allowing for limited types of non-convexities in the objective. The ability to throw in a non-convex constraint, such as nonlinear equalities, would also be nice. As a simple, but frequently occurring example, it would be nice if CVX could support in DCP relaxation mode a non-convex Quadratic Program, which several solvers can handle natively.

On a related front, it would be nice, at least for the case of DCP-compliant (CVX ruleset) problem formulations to be able to have CVX output the Lagrangian Dual problem formulation in as nice or intelligible a way as possible. Perhaps CVX works in such a way that the duals wind up being some horrid looking thing unintelligible to regular folks, so to speak. Going down the list to even less likely to be fulfilled requests, perhaps CVX could (optionally) output a Lagrangian Dual (in as nice a form as possible) for at least some subset of problems formulated in the aforementioned, hypothetical CVX ruleset relaxation mode - I can see how finding the dual (in a meaningful form allowing for dual problem to be input into a solver without much artistry being required by the user) might be harder than for convex problems, as perhaps automating “boundary case” formulation might not be straightforward. Also along similar lines, having CVX formulate the Lagrangian Dual of a non-convex problem (i.e., formulated in relaxation mode) and send it to a convex solver to at minimum get the dual optimum objective value, which serves as a lower bound (for primal minimization) on primal optimum (yeah, maybe there’s a duality gap, and maybe it’s big, but it’s still a lower bound, even if not tight, and maybe it’s useful to the user, even if big), even if the calculations can not be performed in all cases to relate the dual optimum solution back to the corresponding primal variables. Of course, this would be one type of convex relaxation, and perhaps CVX could automatically handle other possible convex relaxations (possibly better than Lagrangian Dual in some cases) and solve them for the user.

One can dream …

Thanks for your consideration. Now back to your regularly scheduled programming of problem formulations which violate CVX’s ruleset, usually because they are not convex.

Edit: This is in response to mcg’s post to my post above.

Thanks for the response. I am a good enough analyst to have, unfortunately in this case, correctly predicted the answer.

Thanks for the tip on YALMIP. I looked into it at the same time as CVX a little over a year ago, but “went” with CVX, because it seemed to require less effort to get up and running, and seemed well suited to a bunch of SDPs I had just conceived and wanted to quickly run (from a human effort, not computer run-time standpoint). Now I am increasingly formulating variations to those SDPs which are no longer convex, and perhaps it will be worth my effort to get up and running with YALMIP to complement CVX. As I advance in years, I find it harder to remember syntax for multiple similar things, and so that was why I probably just let YALMIP go into indefinite hold status, so to speak. I suppose there is some tradeoff at user level to get more flexibility at the expense of ease of use.