In [1]:
# DCP analysis in CVXPY
import cvxpy as cp


x = cp.Variable()
y = cp.Variable()
expr = cp.quad_over_lin(x - y, 1 - cp.maximum(x,y))
print("expression curvature =", expr.curvature)
print("expression sign =", expr.sign)
print("expression is DCP?", expr.is_dcp())
expression curvature = CONVEX
expression sign = NONNEGATIVE
expression is DCP? True