Skip to content

Implement a proper equality check for polyhedron representation objects #30954

@kliem

Description

@kliem
sage: P = (1/2)*polytopes.cube()                                                                                                                                                    
sage: Q = (1/2)*polytopes.cube(backend='field')                                                                                                                                     
sage: for p in P.inequalities(): 
....:     assert p in Q.inequalities() 
....:                                                                                                                                                                               
---------------------------------------------------------------------------
AssertionError                            Traceback (most recent call last)
<ipython-input-16-d0a8f3fbfdbb> in <module>
      1 for p in P.inequalities():
----> 2     assert p in Q.inequalities()
      3 

AssertionError: 

This isn't acceptable. Those inequalites are the same, only the defining vector differs by a positive scalar.

We also define a method is_facet_defining_inequality that checks whether self could replace an inequality of the polyhedron other. This is useful, when other is not full-dimensional and inequalities aren't unique (only after affine_hull_projection).

CC: @jplab @LaisRast

Component: geometry

Keywords: scalars, polyhedra

Author: Jonathan Kliem

Branch/Commit: 9ee3335

Reviewer: Jean-Philippe Labbé

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions