#29116 closed defect (fixed)

affine_basis does not always work when used with orthogonal or orthonormal

Reported by: gh-LaisRast Owned by:
Priority: major Milestone: sage-9.1
Component: geometry Keywords: polytopes, affine_hull
Cc: jipilab, gh-kliem Merged in:
Authors: Jonathan Kliem Reviewers: Laith Rastanawi
Report Upstream: N/A Work issues:
Branch: 7d21717 (Commits, GitHub, GitLab) Commit: 7d2171786b439fd246ae097b5ffc050bba74c39e
Dependencies: #29127 Stopgaps:

Status badges

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 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.

Change History (8)

comment:1 Changed 15 months ago by gh-kliem

  • Dependencies set to #29127

comment:2 Changed 15 months ago by gh-kliem

  • Authors set to Jonathan Kliem
  • Branch set to public/29116
  • Commit set to df7ec00c4ae9ba37900ba59ef3f3903f5000d5ca
  • Status changed from new to needs_review

New commits:

a8359e0implement `a_maximal_chain` for combinatorial polyhedron
6c4c1c0implement `an_affine_basis` for polytopes
3d87ccfmore description in the docs
1b78e87used an_affine_basis to simplify is_inscribed
5e547b3check sign of circumcenter using all vertices of simplex
231c16fapply change to 29125
4fb0f6bhandling small-dimensional cases
3f6013btemporary fix
df7ec00get correct affine basis for affine hull with orthogonal/orthonormal

comment:3 Changed 14 months ago by gh-kliem

  • Branch changed from public/29116 to public/29116-reb
  • Commit changed from df7ec00c4ae9ba37900ba59ef3f3903f5000d5ca to 8b2709ef8514b374255b87da8838e190e6c64e3e

New commits:

61dd4a5implement `a_maximal_chain` for combinatorial polyhedron
a18011fimproved documentation
2e9f25fexposed a_maximal_chain to polyhedron_base
0315652implement `an_affine_basis` for polytopes
554556dmore description in the docs
aa30035used an_affine_basis to simplify is_inscribed
08b263eapply change to 29125
d2d2a8ahandling small-dimensional cases
ba48b17get correct affine basis for affine hull with orthogonal/orthonormal
8b2709etemporary fix

comment:4 Changed 14 months ago by gh-LaisRast

  • 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 14 months ago by gh-LaisRast

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 14 months ago by git

  • 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:

7d21717typo

comment:7 Changed 14 months ago by gh-LaisRast

  • Status changed from needs_review to positive_review

comment:8 Changed 14 months ago by vbraun

  • Branch changed from public/29116-reb to 7d2171786b439fd246ae097b5ffc050bba74c39e
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.