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

Commit

Permalink
pep8 errors fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
mo271 committed Mar 6, 2017
1 parent 508bc6b commit ca97480
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/sage/geometry/polyhedron/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -5079,17 +5079,19 @@ def is_combinatorially_isomorphic(self, other, algo='bipartite_graph'):
if algo == 'bipartite_graph':

def get_incidences(P):
#This function constructs a directed bipartite graph.
#The nodes of the graph are the vertices of the polyhedron
#and the faces of the polyhedron. There is an directed edge
#from a vertex to a face if the vertex is contained in the face.
#We obtain this incidence information from the incidence matrix
# This function constructs a directed bipartite graph.
# The nodes of the graph are the vertices of the polyhedron
# and the facets of the polyhedron. There is an directed edge
# from a vertex to a face if the vertex is contained in the face.
# We obtain this incidence information from the incidence matrix
G = DiGraph()
M = P.incidence_matrix()
#We construct the edges and remove the columns that have all 1s;
#those correspond to faces, that contain all vertices (which happens
#if the polyhedron is not full-dimensional)
edges = [[i, M.ncols()+j] for i, column in enumerate(M.columns()) if any(entry!=1 for entry in column) for j in range(M.nrows()) if M[j,i]==1]
# We construct the edges and remove the columns that have all 1s;
# those correspond to faces, that contain all vertices (which happens
# if the polyhedron is not full-dimensional)
edges = [[i, M.ncols()+j] for i, column in enumerate(M.columns())
if any(entry != 1 for entry in column)
for j in range(M.nrows()) if M[j, i] == 1]
G.add_edges(edges)
return G

Expand Down

0 comments on commit ca97480

Please sign in to comment.