How to get around CVXPY's DCP constraints?

749 Views Asked by At

I am trying to use CVXPY on a mixed-integer program. One of my constraints is of the form

$$y = \begin{cases} g(x) & f(x)\geqslant m\\ 0 & \text{otherwise} \end{cases}$$

for affine functions $f$ and $g$. My construction is $y=\mathbb{I}_{\{f(x)\geqslant m\}}\cdot g(x)$, where I can linearize the indicator variable $\mathbb{I}_{\{f(x)\geqslant m\}}$.

This is convex because $y$ is always convex (either affine or constant). But the DCP ruleset allows no multiplication. Therefore, CVX raises exceptions. Is there any way to get around it?

Any help/correction is appreciated!