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

Commit

Permalink
little improvements, change 'algo' to 'algorithm'
Browse files Browse the repository at this point in the history
  • Loading branch information
mo271 committed Mar 6, 2017
1 parent 0a29d25 commit f0ec516
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/sage/geometry/polyhedron/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -4980,7 +4980,7 @@ def is_full_dimensional(self):
"""
return self.dim() == self.ambient_dim()

def is_combinatorially_isomorphic(self, other, algo='bipartite_graph'):
def is_combinatorially_isomorphic(self, other, algorithm='bipartite_graph'):
r"""
Return whether the polyhedron is combinatorially isomorphic to another polyhedron.
Expand All @@ -4990,7 +4990,7 @@ def is_combinatorially_isomorphic(self, other, algo='bipartite_graph'):
INPUT:
- ``other`` -- a polyhedron object.
- ``algo`` (default = ``bipartite_graph``) -- the algorithm to use.
- ``algorithm`` (default = ``bipartite_graph``) -- the algorithm to use.
The other possible value is ``face_lattice``.
OUTPUT:
Expand All @@ -5010,17 +5010,17 @@ def is_combinatorially_isomorphic(self, other, algo='bipartite_graph'):
True
All the faces of the 3-dimensional permutahedron are either
combinatorially isomorphic to a square or a sixgon::
combinatorially isomorphic to a square or a hexagon::
sage: H = polytopes.regular_polygon(6)
sage: S = polytopes.hypercube(2)
sage: P = polytopes.permutahedron(4)
sage: all(F.as_polyhedron().is_combinatorially_isomorphic(S) or F.as_polyhedron().is_combinatorially_isomorphic(H) for F in P.faces(2))
True
Checking that a regular simplex intersected with its negative,
is combinatorially isomorpic to the intersection of a cube with
a hyperplane perpendicular to its long diagonal::
Checking that a regular simplex intersected with its reflection
through the origin is combinatorially isomorphic to the intersection
of a cube with a hyperplane perpendicular to its long diagonal::
polytopes.regular_polygon(4)
sage: def simplex_intersection(k):
Expand All @@ -5038,7 +5038,7 @@ def is_combinatorially_isomorphic(self, other, algo='bipartite_graph'):
sage: simplex_intersection(3).is_combinatorially_isomorphic(polytopes.octahedron())
True
Two polytopes with the same `f`-vector, but different combinatorial type::
Two polytopes with the same `f`-vector, but different combinatorial types::
sage: P = Polyhedron([[-605520/1525633, -605520/1525633, -1261500/1525633, -52200/1525633, 11833/1525633],\
[-720/1769, -600/1769, 1500/1769, 0, -31/1769], [-216/749, 240/749, -240/749, -432/749, 461/749], \
Expand Down Expand Up @@ -5068,10 +5068,10 @@ def is_combinatorially_isomorphic(self, other, algo='bipartite_graph'):
sage: C = polytopes.hypercube(5)
sage: C.is_combinatorially_isomorphic(C)
True
sage: C.is_combinatorially_isomorphic(C, algo='magic')
sage: C.is_combinatorially_isomorphic(C, algorithm='magic')
Traceback (most recent call last):
...
AssertionError: algo must be 'bipartite graph' or 'face_lattice'
AssertionError: `algorithm` must be 'bipartite graph' or 'face_lattice'
sage: G = Graph()
sage: C.is_combinatorially_isomorphic(G)
Expand All @@ -5090,15 +5090,15 @@ def is_combinatorially_isomorphic(self, other, algo='bipartite_graph'):
assert isinstance(other, Polyhedron_base), "input `other` must be a polyhedron"
assert self.is_compact(), "polyhedron `self` must be bounded"
assert other.is_compact(), "polyhedron `other` must be bounded"
assert algo in ['bipartite_graph', 'face_lattice'], "algo must be 'bipartite graph' or 'face_lattice'"
assert algorithm in ['bipartite_graph', 'face_lattice'], "`algorithm` must be 'bipartite graph' or 'face_lattice'"

# For speed, we check if the polyhedra have the same number of facets and vertices.
# This is faster then building the bipartite graphs first and
# then check that they won't be isomorphic.
if self.n_vertices() != other.n_vertices() or self.n_facets() != other.n_facets():
return False

if algo == 'bipartite_graph':
if algorithm == 'bipartite_graph':

def get_incidences(P):
# This function constructs a directed bipartite graph.
Expand Down

0 comments on commit f0ec516

Please sign in to comment.