Exemple #1
0
 def __div__(self, other):
     """One expression divided by another.
     """
     # Can only divide by scalar constants.
     if other.is_constant() and other.is_scalar():
         return types.div_expr()(self, other)
     else:
         raise TypeError("Can only divide by a scalar constant.")
Exemple #2
0
 def __div__(self, other):
     """One expression divided by another.
     """
     # Can only divide by scalar constants.
     if other.is_constant() and other.is_scalar():
         return types.div_expr()(self, other)
     else:
         raise DCPError("Can only divide by a scalar constant.")