Skip to content

affine_basis does not always work when used with orthogonal or orthonormal #29116

@LaisRast

Description

@LaisRast

When using affine_basis of Polyhedron with orthogonal or orthonormal we get the following errors.

sage: V =[
....:    [1, 0, -1, 0, 0],
....:    [1, 0, 0, -1, 0],
....:    [1, 0, 0, 0, -1],
....:    [1, 0, 0, +1, 0],
....:    [1, 0, 0, 0, +1],
....:    [1, +1, 0, 0, 0]
....:     ]
sage: P = Polyhedron(V)
sage: P.affine_hull()
A 4-dimensional polyhedron in ZZ^4 defined as the convex hull of 6 vertices
sage: P.affine_hull(orthogonal=True) 
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
...
ValueError: V-representation data requires a list of length ambient_dim
sage: P.affine_hull(orthonormal=True, extend=True)
A 4-dimensional polyhedron in AA^4 defined as the convex hull of 5 vertices and 1 line

This happens because the method for computing an affine basis depends on the order of the vertices. We fix that by computing an affine basis of the polyhedron in the right way.

Depends on #29127

CC: @jplab @kliem

Component: geometry

Keywords: polytopes, affine_hull

Author: Jonathan Kliem

Branch/Commit: 7d21717

Reviewer: Laith Rastanawi

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions