#6214: Polyhedra compute incorrect dimension when defined through inequalities
------------------------+---------------------------------------------------
Reporter: mhampton | Owner: mhampton
Type: defect | Status: needs_review
Priority: major | Milestone:
Component: geometry | Keywords:
Author: | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
------------------------+---------------------------------------------------
Changes (by vbraun):
* cc: vbraun (added)
* status: new => needs_review
Comment:
mhampton: Something is wrong with your example, the two inequalities [-31,
-1, -1, -1, -1, -1, -1], [31, 1, 1, 1, 1, 1, 1] mean sum(x_i)+31=0. The
other inequalities imply positive x_i, so there is no solution.
{{{
sage: Polyhedron(ieqs=pdata).dim()
-1
}}}
The original example also works as it should:
{{{
sage: positive_coords = Polyhedron(ieqs=[[0, 1, 0, 0, 0, 0, 0], [0, 0, 1,
0, 0, 0, 0], [0, 0, 0, 1, 0, 0, 0], [0, 0, 0, 0, 1, 0, 0], [0, 0, 0, 0, 0,
1, 0], [0, 0, 0, 0, 0, 0, 1]])
sage: P = Polyhedron(ieqs=positive_coords.inequalities() +
[[0,0,1,-1,-1,1,0], [0,0,-1,1,-1,1,0]], eqns=[[-31,1,1,1,1,1,1]])
sage: P
A 5-dimensional polyhedron in QQ^6 defined as the convex hull of 7
vertices.
sage: P.dim()
5
sage: P.Vrepresentation()
[A vertex at (0, 31/2, 31/2, 0, 0, 0), A vertex at (0, 31/2, 0, 0, 31/2,
0), A vertex at (0, 0, 0, 0, 31, 0), A vertex at (0, 0, 31/2, 0, 31/2, 0),
A vertex at (0, 0, 0, 31/2, 31/2, 0), A vertex at (31, 0, 0, 0, 0, 0), A
vertex at (0, 0, 0, 0, 0, 31)]
}}}
I think it is a good example to add to the Polyhdedron documentation,
patch is included.
The patch also adds a Polyhedron.contains(point) and
Polyhedron.interior_contains(point) method, as that is probably a common
use. Finally, I removed some spurious assignments to docstrings that
overwrote previously-defined docstrings.
I'm sorry for bunching patches together, but I think that the other
changes are uncontroversial. If anybody feels strongly about that I can
disentangle them.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/6214#comment:5>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.