Opened 2 years ago
Closed 2 years ago
#29116 closed defect (fixed)
affine_basis does not always work when used with orthogonal or orthonormal
Reported by:  ghLaisRast  Owned by:  

Priority:  major  Milestone:  sage9.1 
Component:  geometry  Keywords:  polytopes, affine_hull 
Cc:  jipilab, ghkliem  Merged in:  
Authors:  Jonathan Kliem  Reviewers:  Laith Rastanawi 
Report Upstream:  N/A  Work issues:  
Branch:  7d21717 (Commits, GitHub, GitLab)  Commit:  7d2171786b439fd246ae097b5ffc050bba74c39e 
Dependencies:  #29127  Stopgaps: 
Description
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 4dimensional 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: Vrepresentation data requires a list of length ambient_dim
sage: P.affine_hull(orthonormal=True, extend=True) A 4dimensional 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.
Change History (8)
comment:1 Changed 2 years ago by
 Dependencies set to #29127
comment:2 Changed 2 years ago by
 Branch set to public/29116
 Commit set to df7ec00c4ae9ba37900ba59ef3f3903f5000d5ca
 Status changed from new to needs_review
comment:3 Changed 2 years ago by
 Branch changed from public/29116 to public/29116reb
 Commit changed from df7ec00c4ae9ba37900ba59ef3f3903f5000d5ca to 8b2709ef8514b374255b87da8838e190e6c64e3e
New commits:
61dd4a5  implement `a_maximal_chain` for combinatorial polyhedron

a18011f  improved documentation

2e9f25f  exposed a_maximal_chain to polyhedron_base

0315652  implement `an_affine_basis` for polytopes

554556d  more description in the docs

aa30035  used an_affine_basis to simplify is_inscribed

08b263e  apply change to 29125

d2d2a8a  handling smalldimensional cases

ba48b17  get correct affine basis for affine hull with orthogonal/orthonormal

8b2709e  temporary fix

comment:4 Changed 2 years ago by
 Reviewers set to Laith Rastanawi
 Status changed from needs_review to positive_review
Since #29127 is on "positive review", I think this one also should be on "positive review". It looks good to me. (pycodestyle warnings are not sourced from her)
comment:5 Changed 2 years ago by
I forgot to mention:
 # We implicitely translate the first vertex of the affine basis to zero. + # We implicitly translate the first vertex of the affine basis to zero.
comment:6 Changed 2 years ago by
 Commit changed from 8b2709ef8514b374255b87da8838e190e6c64e3e to 7d2171786b439fd246ae097b5ffc050bba74c39e
 Status changed from positive_review to needs_review
Branch pushed to git repo; I updated commit sha1 and set ticket back to needs_review. New commits:
7d21717  typo

comment:7 Changed 2 years ago by
 Status changed from needs_review to positive_review
comment:8 Changed 2 years ago by
 Branch changed from public/29116reb to 7d2171786b439fd246ae097b5ffc050bba74c39e
 Resolution set to fixed
 Status changed from positive_review to closed
Note: See
TracTickets for help on using
tickets.
New commits:
implement `a_maximal_chain` for combinatorial polyhedron
implement `an_affine_basis` for polytopes
more description in the docs
used an_affine_basis to simplify is_inscribed
check sign of circumcenter using all vertices of simplex
apply change to 29125
handling smalldimensional cases
temporary fix
get correct affine basis for affine hull with orthogonal/orthonormal