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

Commit

Permalink
fixed 28506 by trying fraction field at failure
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Kliem committed Sep 16, 2019
1 parent fa1a517 commit e86ea8b
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions src/sage/geometry/polyhedron/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3522,7 +3522,12 @@ def minkowski_difference(self, other):
ieq[0] += min(values) # shift constant term
new_ieqs.append(ieq)
P = self.parent()
return P.element_class(P, None, [new_ieqs, new_eqns])
try:
return P.element_class(P, None, [new_ieqs, new_eqns])
except TypeError:
# Some vertices might be fractions.
P = P.change_ring(P.base_ring().fraction_field())
return P.element_class(P, None, [new_ieqs, new_eqns])

def __sub__(self, other):
r"""
Expand Down Expand Up @@ -3906,7 +3911,12 @@ def direct_sum(self, other):
for l in other.line_generator() ] )

parent = self.parent().change_ring(new_ring, ambient_dim=self.ambient_dim() + other.ambient_dim())
return parent.element_class(parent, [new_vertices, new_rays, new_lines], None)
try:
return parent.element_class(parent, [new_vertices, new_rays, new_lines], None)
except TypeError:
# Some vertices might be fractions.
parent = parent.change_ring(new_ring.fraction_field())
return parent.element_class(parent, [new_vertices, new_rays, new_lines], None)

def dilation(self, scalar):
"""
Expand Down Expand Up @@ -4359,7 +4369,12 @@ def face_truncation(self, face, linear_coefficients=None, cut_frac=None):
new_eqns = self.equations_list()

parent = self.parent().base_extend(cut_frac)
return parent.element_class(parent, None, [new_ieqs, new_eqns])
try:
return parent.element_class(parent, None, [new_ieqs, new_eqns])
except TypeError:
# Some vertices might be fractions.
parent = parent.change_ring(parent.base_ring().fraction_field())
return parent.element_class(parent, None, [new_ieqs, new_eqns])

def stack(self, face, position=None):
r"""
Expand Down

0 comments on commit e86ea8b

Please sign in to comment.