Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Making some additional improvements.
Browse files Browse the repository at this point in the history
  • Loading branch information
Travis Scrimshaw committed Jan 3, 2016
1 parent af33acf commit e014037
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/sage/groups/matrix_gps/coxeter_group.py
Expand Up @@ -509,9 +509,10 @@ def has_right_descent(self, i):
i = self.parent().index_set().index(i)
n = len(self.parent().index_set())
M = self.matrix()
zero = M.base_ring().zero()
# When working over the UCF, this is the bottleneck because it has
# to convert the entries to QQbar and do the comparison there.
return all(M[j,i] <= 0 for j in range(n))
return all(M[j,i] <= zero for j in range(n))

def canonical_matrix(self):
r"""
Expand Down
11 changes: 8 additions & 3 deletions src/sage/groups/matrix_gps/group_element.py
Expand Up @@ -322,8 +322,10 @@ def _mul_(self,other):
[0 1]
"""
parent = self.parent()
return parent.element_class(parent, self._matrix * other._matrix,
check=False, convert=False)
M = self._matrix * other._matrix
# Make it immutable so the constructor doesn't make a copy
M.set_immutable()
return parent.element_class(parent, M, check=False, convert=False)

def __invert__(self):
"""
Expand All @@ -347,7 +349,10 @@ def __invert__(self):
[0 1]
"""
parent = self.parent()
return parent.element_class(parent, ~self._matrix, check=False, convert=False)
M = ~self._matrix
# Make it immutable so the constructor doesn't make a copy
M.set_immutable()
return parent.element_class(parent, M, check=False, convert=False)

inverse = __invert__

Expand Down

0 comments on commit e014037

Please sign in to comment.