Opened 8 years ago
Closed 7 years ago
#12193 closed defect (fixed)
Dimension of Polyhedron is not well defined
Reported by: | jipilab | Owned by: | mhampton |
---|---|---|---|
Priority: | major | Milestone: | sage-5.6 |
Component: | geometry | Keywords: | dimension, polytope, polyhedron |
Cc: | Merged in: | sage-5.6.beta3 | |
Authors: | Volker Braun | Reviewers: | David Loeffler |
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | #11634, #13638, #11763 | Stopgaps: |
Description (last modified by )
Given a vector space V and a polyhedron P, the dimension of P is the dimension of its affine hull, i.e. the smallest affine subspace of V in which P can live. (For a reference, see G.M. Ziegler's book "Lectures on Polytopes" p.5)
Right now, the dimension of a Polyhedron is defined as:
def dim(self): """ Return the dimension of the polyhedron. EXAMPLES:: sage: simplex = Polyhedron(vertices = [[1,0,0,0],[0,0,0,1],[0,1,0,0],[0,0,1,0]]) sage: simplex.dim() 3 sage: simplex.ambient_dim() 4 """ return self.ambient_dim() - self.n_equations()
But this is obviously not the truthful definition. With the way things are now, this leads to various problems such as:
sage: P1=Polyhedron(vertices=[[1,0,0],[0,1,0],[0,0,1]]) sage: P2=Polyhedron(vertices=[[2,0,0],[0,2,0],[0,0,2]]) sage: Inter=P1.intersection(P2) sage: Inter The empty polyhedron in QQ^3. sage: Inter.dim() 1
While the right answer should be -1.
One can produce many other examples...
Apply trac_12193_fix_dimension.patch
Attachments (1)
Change History (17)
comment:1 Changed 8 years ago by
- Dependencies set to #11763
- Description modified (diff)
- Status changed from new to needs_review
comment:2 Changed 8 years ago by
I've added a new patch which will stop the patchbot whining about trailing whitespace and commit messages.
Apply trac_12193_fix_dimension-v2.patch
comment:3 Changed 8 years ago by
I'm fine with your changes :-)
comment:4 Changed 8 years ago by
- Status changed from needs_review to positive_review
comment:5 Changed 8 years ago by
- Dependencies changed from #11763 to #11634, #11763
- Milestone changed from sage-5.0 to sage-pending
comment:6 Changed 8 years ago by
Rediffed for sage-5.0.beta11, nothing of interest changed.
comment:7 Changed 7 years ago by
Please fill in your real name as Reviewer.
comment:8 Changed 7 years ago by
Rebased for #11763
comment:9 Changed 7 years ago by
- Milestone changed from sage-pending to sage-5.5
comment:10 Changed 7 years ago by
- Dependencies changed from #11634, #11763 to #11634, #13638, #11763
- Milestone changed from sage-5.5 to sage-pending
comment:11 Changed 7 years ago by
- Reviewers set to David Loeffler
comment:12 Changed 7 years ago by
For the patchbot: apply trac_12193_fix_dimension.patch only
comment:13 Changed 7 years ago by
The patchbot found a machine-dependent issue in a cmp() doctest, fixed now.
comment:14 Changed 7 years ago by
Updated patch to push one patch hunk down to #11763.
comment:15 Changed 7 years ago by
- Milestone changed from sage-pending to sage-5.6
comment:16 Changed 7 years ago by
- Merged in set to sage-5.6.beta3
- Resolution set to fixed
- Status changed from positive_review to closed
Fixed by attached patch.