Two more “disciplined” dialects beyond DCP — enough to know they exist and when to reach for them. Both are covered in depth on the CVXR website.
CVXR’s convex grammar (DCP) is not the only disciplined rule set. Two siblings extend the same idea — compose from a library, get a guarantee — to other problem classes. We mention them briefly here; follow the links for the full treatment.
15.1 Disciplined Geometric Programming (DGP)
Some problems are not convex in the variables but become convex after a log-log change of variables — geometric programs, built from positive variables, monomials, and posynomials. They appear in engineering design, and in statistics in problems involving products and ratios of positive quantities. You write them naturally and pass gp = TRUE. The classic example maximizes the volume of a box subject to area limits:
x <-Variable(pos =TRUE); y <-Variable(pos =TRUE); z <-Variable(pos =TRUE)prob <-Problem(Maximize(x * y * z),list(2* (x * z + y * z) <=10, x * y <=4))psolve(prob, gp =TRUE)
[1] 5
round(c(x =value(x), y =value(y), z =value(z)), 3)
x y z
2.00 2.00 1.25
The objective x * y * z multiplies three variables — not DCP at all — yet DGP solves it to global optimality. See the DGP Tutorial.
15.2 Disciplined Quasiconvex Programming (DQCP)
A quasiconvex function has convex sub-level sets but need not be convex itself (think of ratios like \(\|Ax-b\|/c^\top x\)). DCP cannot handle these, but DQCP can, via a sequence of convex feasibility problems; you pass qcp = TRUE. A tiny example minimizes \((a+1)/\sqrt{a}\), which is quasiconvex on \(a > 0\):
a <-Variable(pos =TRUE)prob <-Problem(Minimize((a +1) /sqrt(a)))c(is_dqcp =is_dqcp(prob), optimum =psolve(prob, qcp =TRUE), a =value(a))
is_dqcp optimum a
1.000000 2.000000 1.000118
The minimum is \(2\) at \(a = 1\), found without you having to know the function was quasiconvex. See the DQCP Tutorial.
15.3 Where this leaves us
You now have the whole map: DCP (convex, this book’s backbone), DPP (parametrized, for fast re-solves and derivatives), DGP (log-log convex), DQCP (quasiconvex), and DNLP (smooth nonconvex). Each is the same disciplined bargain — follow the grammar, get a solvable problem — and CVXR checks compliance for you with the matching is_*() predicate. The website’s examples gallery has dozens more worked problems across all of them.