DCP analysis

using Convex
x = Variable();
y = Variable();
expr = quadoverlin(x - y, 1 - max(x, y))
qol (convex; positive)
├─ + (affine; real)
│  ├─ real variable (id: 147…993)
│  └─ Convex.NegateAtom (affine; real)
│     └─ real variable (id: 189…608)
└─ + (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.