Ejemplo n.º 1
0
 def __getitem__(self, key):
     """Return a slice/index into the expression.
     """
     # Returning self for scalars causes
     # the built-in sum to hang.
     if ku.is_special_slice(key):
         return cvxtypes.index().get_special_slice(self, key)
     else:
         return cvxtypes.index()(self, key)
Ejemplo n.º 2
0
 def __getitem__(self, key):
     """Return a slice/index into the expression.
     """
     # Returning self for scalars causes
     # the built-in sum to hang.
     if ku.is_special_slice(key):
         return types.index().get_special_slice(self, key)
     else:
         return types.index()(self, key)
Ejemplo n.º 3
0
 def __getitem__(self, key):
     """Return a slice/index into the expression.
     """
     # Returning self for scalars causes
     # the built-in sum to hang.
     if isinstance(key, tuple) and len(key) == 0:
         return self
     elif ku.is_special_slice(key):
         return cvxtypes.special_index()(self, key)
     else:
         return cvxtypes.index()(self, key)