diff --git a/cvxpy/atoms/max.py b/cvxpy/atoms/max.py index a849ec8c1f..2824f47f1b 100644 --- a/cvxpy/atoms/max.py +++ b/cvxpy/atoms/max.py @@ -114,10 +114,6 @@ def is_atom_log_log_concave(self) -> bool: """ return False - def is_smooth(self): - """max is not a smooth function of its args""" - return False - def is_incr(self, idx) -> bool: """Is the composition non-decreasing in argument idx? """ diff --git a/cvxpy/expressions/expression.py b/cvxpy/expressions/expression.py index a9c0daa112..32bdc80a61 100644 --- a/cvxpy/expressions/expression.py +++ b/cvxpy/expressions/expression.py @@ -348,13 +348,13 @@ def is_concave(self) -> bool: """ raise NotImplementedError() - #@abc.abstractmethod + @abc.abstractmethod def is_linearizable_convex(self) -> bool: """Is the expression convex after linearizing all smooth subexpressions? """ raise NotImplementedError() - #@abc.abstractmethod + @abc.abstractmethod def is_linearizable_concave(self) -> bool: """Is the expression concave after linearizing all smooth subexpressions? """ diff --git a/cvxpy/transforms/indicator.py b/cvxpy/transforms/indicator.py index 7e44cc245a..dfa472714a 100644 --- a/cvxpy/transforms/indicator.py +++ b/cvxpy/transforms/indicator.py @@ -57,6 +57,12 @@ def is_concave(self) -> bool: """ return False + def is_linearizable_convex(self) -> bool: + return True + + def is_linearizable_concave(self) -> bool: + return False + def is_log_log_convex(self) -> bool: return False diff --git a/cvxpy/transforms/partial_optimize.py b/cvxpy/transforms/partial_optimize.py index ff3ec925e3..9e7ed31980 100644 --- a/cvxpy/transforms/partial_optimize.py +++ b/cvxpy/transforms/partial_optimize.py @@ -144,6 +144,12 @@ def is_concave(self) -> bool: return self.args[0].is_dcp() and \ type(self.args[0].objective) == Maximize + def is_linearizable_convex(self) -> bool: + return self.is_convex() + + def is_linearizable_concave(self) -> bool: + return self.is_concave() + def is_dpp(self, context: str = 'dcp') -> bool: """The expression is a disciplined parameterized expression. """