Suppose I want to minimize below objective function
$\sum | g(x_i) \cdot I_{g(x_i)<0} |^2$
i.e, the latter penalty terms like $ |g(x_i)|^2 $ are only computed when $g(x_i)<0$. $|g(x_i)|^2$ are convex functions. Is there a way to formulate it? I know sum of convex functions are convex, but if I have added this strange "filter" on the objective function, I hope it's still convex..