Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dimension of Polyhedron is not well defined #12193

Closed
jplab opened this issue Dec 19, 2011 · 17 comments
Closed

Dimension of Polyhedron is not well defined #12193

jplab opened this issue Dec 19, 2011 · 17 comments

Comments

@jplab
Copy link

jplab commented Dec 19, 2011

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

Depends on #11634
Depends on #13638
Depends on #11763

Component: geometry

Keywords: dimension, polytope, polyhedron

Author: Volker Braun

Reviewer: David Loeffler

Merged: sage-5.6.beta3

Issue created by migration from https://trac.sagemath.org/ticket/12193

@vbraun
Copy link
Member

vbraun commented Dec 19, 2011

Dependencies: #11763

@vbraun
Copy link
Member

vbraun commented Dec 19, 2011

comment:1

Fixed by attached patch.

@vbraun

This comment has been minimized.

@vbraun
Copy link
Member

vbraun commented Dec 19, 2011

Author: Volker Braun

@loefflerd
Copy link
Mannequin

loefflerd mannequin commented Mar 12, 2012

comment:2

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

@vbraun
Copy link
Member

vbraun commented Mar 12, 2012

comment:3

I'm fine with your changes :-)

@jdemeyer
Copy link

Changed dependencies from #11763 to #11634, #11763

@jdemeyer jdemeyer removed this from the sage-5.0 milestone Mar 15, 2012
@vbraun
Copy link
Member

vbraun commented Mar 29, 2012

comment:6

Rediffed for sage-5.0.beta11, nothing of interest changed.

@jdemeyer
Copy link

comment:7

Please fill in your real name as Reviewer.

@vbraun
Copy link
Member

vbraun commented Oct 23, 2012

comment:8

Rebased for #11763

@vbraun vbraun added this to the sage-5.5 milestone Oct 23, 2012
@vbraun vbraun removed the pending label Oct 23, 2012
@jdemeyer
Copy link

Changed dependencies from #11634, #11763 to #11634, #13638, #11763

@jdemeyer jdemeyer removed this from the sage-5.5 milestone Oct 24, 2012
@vbraun
Copy link
Member

vbraun commented Nov 28, 2012

Reviewer: David Loeffler

@vbraun
Copy link
Member

vbraun commented Nov 28, 2012

comment:12

For the patchbot: apply trac_12193_fix_dimension.patch only

@vbraun
Copy link
Member

vbraun commented Dec 1, 2012

comment:13

The patchbot found a machine-dependent issue in a cmp() doctest, fixed now.

@vbraun
Copy link
Member

vbraun commented Dec 18, 2012

Updated patch

@vbraun
Copy link
Member

vbraun commented Dec 18, 2012

comment:14

Attachment: trac_12193_fix_dimension.patch.gz

Updated patch to push one patch hunk down to #11763.

@jdemeyer jdemeyer added this to the sage-5.6 milestone Dec 21, 2012
@jdemeyer jdemeyer removed the pending label Dec 21, 2012
@jdemeyer
Copy link

jdemeyer commented Jan 7, 2013

Merged: sage-5.6.beta3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants