Skip to content
This repository was archived by the owner on Feb 1, 2023. It is now read-only.

Commit 5771568

Browse files
author
Jonathan Kliem
committed
small changes
1 parent 462db8d commit 5771568

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

src/sage/geometry/polyhedron/base.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4423,6 +4423,13 @@ def stack(self, face, position=None):
44234423
A ray in the direction (1, 1),
44244424
A vertex at (2, 0))
44254425
4426+
Stacking requires a proper face::
4427+
4428+
sage: Q.stack(Q.faces(2)[0])
4429+
Traceback (most recent call last):
4430+
...
4431+
ValueError: can only stack on proper face
4432+
44264433
TESTS:
44274434
44284435
Checking that the backend is preserved::
@@ -4432,8 +4439,9 @@ def stack(self, face, position=None):
44324439
sage: stack.backend()
44334440
'field'
44344441
4435-
Checking that stacked point needs to be in the interior of
4436-
``locus_polyhedron``::
4442+
The stacked vertex may not satisfy any inequality
4443+
defining the original polyhedron::
4444+
44374445
sage: P = polytopes.octahedron()
44384446
sage: P.stack(P.faces(2)[0],4)
44394447
Traceback (most recent call last):

src/sage/geometry/polyhedron/representation.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ def b(self):
447447

448448
def neighbors(self):
449449
"""
450-
Iterate over the adjacent facets (i.e. inequalities/equations)
450+
Iterate over the adjacent facets (i.e. inequalities).
451451
452452
Only defined for inequalities.
453453
@@ -464,7 +464,7 @@ def neighbors(self):
464464
465465
TESTS:
466466
467-
Checking that it works for polyhedra with equations::
467+
Checking that :trac:`28463` is fixed::
468468
469469
sage: P = polytopes.simplex()
470470
sage: F1 = P.Hrepresentation()[1]
@@ -473,17 +473,18 @@ def neighbors(self):
473473
An inequality (0, 0, 1, 0) x + 0 >= 0,
474474
An inequality (0, 0, 0, 1) x + 0 >= 0]
475475
476-
Does not work for inequalities::
476+
Does not work for equalities::
477477
478478
sage: F0 = P.Hrepresentation()[0]
479479
sage: list(F0.neighbors())
480480
Traceback (most recent call last):
481481
...
482-
AssertionError: must be inequality
482+
TypeError: must be inequality
483483
"""
484484
# The adjacency matrix does not include equations.
485485
n_eqs = self.polyhedron().n_equations()
486-
assert self.is_inequality(), "must be inequality"
486+
if not self.is_inequality():
487+
raise TypeError("must be inequality")
487488

488489
adjacency_matrix = self.polyhedron().facet_adjacency_matrix()
489490
for x in self.polyhedron().Hrep_generator():

0 commit comments

Comments
 (0)