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

Commit

Permalink
more examples to incidence matrix docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Kliem committed Oct 22, 2019
1 parent 0e419eb commit e50590c
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions src/sage/geometry/polyhedron/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2365,6 +2365,38 @@ def incidence_matrix(self):
True
sage: p.incidence_matrix() [2,0] # note: not symmetric
0
The incidence matrix depends on the ambient dimension::
sage: simplex = polytopes.simplex(); simplex
A 3-dimensional polyhedron in ZZ^4 defined as the convex hull of 4 vertices
sage: simplex.incidence_matrix()
[1 1 1 1 0]
[1 1 1 0 1]
[1 1 0 1 1]
[1 0 1 1 1]
sage: simplex = simplex.affine_hull(); simplex
A 3-dimensional polyhedron in ZZ^3 defined as the convex hull of 4 vertices
sage: simplex.incidence_matrix()
[1 1 1 0]
[1 1 0 1]
[1 0 1 1]
[0 1 1 1]
The incidence matrix is not unique up to permutation
for unbounded polyhedra::
sage: triangle = polytopes.regular_polygon(3)
sage: triangle.incidence_matrix()
[0 1 1]
[1 0 1]
[1 1 0]
sage: open_triangle = Polyhedron(vertices=[[0,1], [1,0]], rays=[[1,1]])
sage: open_triangle.incidence_matrix()
[1 1 0]
[1 0 1]
[0 1 1]
"""
incidence_matrix = matrix(ZZ, self.n_Vrepresentation(),
self.n_Hrepresentation(), 0)
Expand Down

0 comments on commit e50590c

Please sign in to comment.