DCP analysis
using Convex
x = Variable();
y = Variable();
expr = quadoverlin(x - y, 1 - max(x, y))
qol (convex; positive)
├─ + (affine; real)
│ ├─ real variable (id: 333…464)
│ └─ Convex.NegateAtom (affine; real)
│ └─ real variable (id: 109…683)
└─ + (concave; real)
├─ [1;;]
└─ Convex.NegateAtom (concave; real)
└─ max (convex; real)
├─ …
└─ …
We can see from the printing of the expression that this quadoverlin
(qol
) atom is convex with positive sign. We can query these programmatically using the vexity
and sign
functions:
println("expression convexity = ", vexity(expr));
println("expression sign = ", sign(expr));
expression convexity = Convex.ConvexVexity()
expression sign = Positive()
This page was generated using Literate.jl.