Opened 10 years ago
Closed 8 years ago
#10445 closed enhancement (fixed)
A Polyhedron should have a "is_simplicial" method.
Reported by: | jplabbe | Owned by: | mhampton |
---|---|---|---|
Priority: | minor | Milestone: | sage-5.7 |
Component: | geometry | Keywords: | simplicial, polytope |
Cc: | mhampton, novoselt | Merged in: | sage-5.7.beta3 |
Authors: | Frédéric Chapoton | Reviewers: | Andrey Novoseltsev |
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description
Presently, one can not ask if a polytope is simplicial (cf. http://en.wikipedia.org/wiki/Simplicial_polytope for the definition).
I would like to have something like:
sage: p = polytopes.n_cube(3) sage: p.is_simplicial() <------------- False <------------------------------- sage: q = polytopes.n_simplex(5) sage: q.is_simplicial() <------------- True <--------------------------------
Attachments (1)
Change History (12)
comment:1 Changed 10 years ago by
- Summary changed from A Polyhedron should have a "is_simplicial" to A Polyhedron should have a "is_simplicial" method.
comment:2 Changed 10 years ago by
- Cc novoselt added
comment:3 follow-up: ↓ 5 Changed 10 years ago by
comment:4 Changed 10 years ago by
Oops, sorry, went a little too fast there. Here's one that might actually work:
def is_simplicial(pq): """ Tests if a polytope is simplicial, i.e. every facet is a simplex. EXAMPLES:: sage: p = Polyhedron([[0,0,0],[1,0,0],[0,1,0],[0,0,1]]) sage: p.is_simplicial() True sage: p2 = Polyhedron([[1, 1, 1], [-1, 1, 1], [1, -1, 1], [-1, -1, 1], [1, 1, -1]]) sage: p2.is_simplicial() False """ for f in pq.facial_incidences(): if len(f[1]) != pq.dim(): return False return True
comment:5 in reply to: ↑ 3 Changed 10 years ago by
Replying to mhampton:
Should non-compact polyhedra be simplicial if they have simplicial facets?
What exactly do you mean by facets here? Do you include unbounded ones?
There is a standard notion of a simplicial cone which means that its dimension is equal to the number of edges. I think is_simplicial
for arbitrary polyhedra should either adhere to this or raise NotImplementedError
for all unbounded polyhedra. I guess the right generalization is to say that it is simplicial in the projective space.
comment:6 Changed 8 years ago by
- Status changed from new to needs_review
comment:7 Changed 8 years ago by
- Status changed from needs_review to needs_work
- Work issues set to unbounded case
I think my 2-year old comment still has to be taken into account.
Changed 8 years ago by
comment:8 Changed 8 years ago by
- Status changed from needs_work to needs_review
I have added a NotImplementedError? for unbounded polyhedra
comment:9 Changed 8 years ago by
- Reviewers set to Andrey Novoseltsev
- Status changed from needs_review to positive_review
comment:10 Changed 8 years ago by
- Work issues unbounded case deleted
comment:11 Changed 8 years ago by
- Merged in set to sage-5.7.beta3
- Resolution set to fixed
- Status changed from positive_review to closed
Wow, I thought we had already done that at some point. Here's a first attempt:
Should non-compact polyhedra be simplicial if they have simplicial facets?