Skip to content

affine hull of one point polyhedron #23355

@mo271

Description

@mo271

When using the orthogonal/orthonormal feature of the affine hull function of a polyhedron (introduced in #22804), there is a problem with the one point polyhedron:

sage: P = Polyhedron([[7]])
sage: P
A 0-dimensional polyhedron in ZZ^1 defined as the convex hull of 1 vertex
sage: P.affine_hull()
A 0-dimensional polyhedron in ZZ^0 defined as the convex hull of 1 verte
sage: P.affine_hull(orthogonal='True')
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
...
TypeError: unsupported operand parent(s) for *: 'Full MatrixSpace of 0 by 0 dense matrices over Integer Ring' and 'Ambient free module of rank 1 over the principal ideal domain Integer Ring'
sage: P.affine_hull(orthonormal='True')
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
...
TypeError: unsupported operand parent(s) for *: 'Full MatrixSpace of 0 by 0 dense matrices over Integer Ring' and 'Ambient free module of rank 1 over the principal ideal domain Integer Ring'

This is how it should be:

sage: P = Polyhedron([[7]]); P
A 0-dimensional polyhedron in ZZ^1 defined as the convex hull of 1 vertex
sage: P.affine_hull()
A 0-dimensional polyhedron in ZZ^0 defined as the convex hull of 1 vertex
sage: P.affine_hull(orthonormal='True')
A 0-dimensional polyhedron in QQ^0 defined as the convex hull of 1 vertex
sage: P.affine_hull(orthogonal='True')
A 0-dimensional polyhedron in QQ^0 defined as the convex hull of 1 vertex

Depends on #22804

CC: @videlec @jplab

Component: geometry

Keywords: polyhedron

Author: Moritz Firsching

Branch/Commit: 9fccf4e

Reviewer: Jean-Philippe Labbé

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions