Set linear objective of problem.

def set_objective(self, expression):
        """Set linear objective of problem."""

        if isinstance(expression, numbers.Number):
            # Allow expressions with no variables as objective,
            # represented as a number
            expression = Expression()

        self._p.setObjective(
            self._grb_expr_from_value_set(expression.values()))