Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CombinatorialPolyhedron improve initialization, remove bug for unbounded polyhedra #27987

Closed
kliem opened this issue Jun 14, 2019 · 31 comments
Closed

Comments

@kliem
Copy link
Contributor

kliem commented Jun 14, 2019

CombinatorialPolyhedron as of #26887 only requires the number of lines (as n_lines in Polyhedron_base). This does not suffice, as

sage: P1 = Polyhedron(vertices=[[0,1],[1,0]], rays=[[1,1]])
sage: P2 = Polyhedron(vertices=[[0,1],[1,0],[1,1]])
sage: P1.incidence_matrix() == P2.incidence_matrix()
True

Instead of just specifying the n_lines, one should specify unbounded and a far face.

Unfortunately, determining the rays from just the incidence matrix does not seem to work.

Now with the far face at hand anyway, it's much easier to determine the (combinatorial) vertices.

CC: @jplab @tscrim @videlec

Component: geometry

Author: Jonathan Kliem

Branch/Commit: 806a217

Reviewer: Travis Scrimshaw

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

@kliem kliem added this to the sage-8.8 milestone Jun 14, 2019
@kliem kliem changed the title CombinatorialPolyhedron improve initialization, remove bug for unbounded polyhedra CombinatorialPolyhedron improve initialization, remove bug for unbounded polyhedra Jun 14, 2019
@kliem
Copy link
Contributor Author

kliem commented Jun 14, 2019

Last 10 new commits:

9b69f50added documentation and examples to each module
4e8fd8ccorrect hyperlinks
72ac3b0documentation fix
611099fDo not iterate twice for CombinatorialPolyhedron.facets()
d38e130added combinatorial face
ca60665improved docstring in list_of_all_faces
abe00b6fixed small issues
8765313A number of small edits.
05ffcccMerge branch 'public/26887' of git://trac.sagemath.org/sage into develop
39810e5changed input of combintorial polyhedron

@kliem
Copy link
Contributor Author

kliem commented Jun 14, 2019

Branch: public/27987

@kliem
Copy link
Contributor Author

kliem commented Jun 14, 2019

Commit: 39810e5

@embray
Copy link
Contributor

embray commented Jun 14, 2019

comment:3

As the Sage-8.8 release milestone is pending, we should delete the sage-8.8 milestone for tickets that are not actively being worked on or that still require significant work to move forward. If you feel that this ticket should be included in the next Sage release at the soonest please set its milestone to the next release milestone (sage-8.9).

@embray embray removed this from the sage-8.8 milestone Jun 14, 2019
@kliem kliem added this to the sage-8.9 milestone Jul 1, 2019
@fchapoton
Copy link
Contributor

comment:5

There is also a python3 failing doctest:

This triggers a new failing doctest with python3-sage:

sage -t --long src/sage/geometry/polyhedron/combinatorial_polyhedron/base.pyx
**********************************************************************
File "src/sage/geometry/polyhedron/combinatorial_polyhedron/base.pyx", line 937, in sage.geometry.polyhedron.combinatorial_polyhedron.base.CombinatorialPolyhedron.edge_graph
Failed example:
    G.degree()
Expected:
    [4, 3, 4, 3, 4]
Got:
    [3, 4, 4, 3, 4]

@fchapoton
Copy link
Contributor

comment:6

I have made #28153 for the py3 problem, please review.

@kliem
Copy link
Contributor Author

kliem commented Jul 11, 2019

Changed commit from 39810e5 to cdc1522

@kliem
Copy link
Contributor Author

kliem commented Jul 11, 2019

Changed branch from public/27987 to public/27987-new

@kliem
Copy link
Contributor Author

kliem commented Jul 11, 2019

New commits:

cdc1522combinatorial polyhedron uses far face as a bug fix

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 11, 2019

Branch pushed to git repo; I updated commit sha1. New commits:

c2f175dsmall changes

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 11, 2019

Changed commit from cdc1522 to c2f175d

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 11, 2019

Branch pushed to git repo; I updated commit sha1. New commits:

b90d253more small changes

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 11, 2019

Changed commit from c2f175d to b90d253

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 11, 2019

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

d6d663acombinatorial polyhedron uses far face as a bug fix

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 11, 2019

Changed commit from b90d253 to d6d663a

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 11, 2019

Changed commit from d6d663a to 14d17a8

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 11, 2019

Branch pushed to git repo; I updated commit sha1. New commits:

14d17a8added doctest reporting the bug fix

@kliem
Copy link
Contributor Author

kliem commented Jul 11, 2019

New commits:

14d17a8added doctest reporting the bug fix

@kliem

This comment has been minimized.

@kliem
Copy link
Contributor Author

kliem commented Jul 12, 2019

comment:13

https://patchbot.sagemath.org/log/27987/debian/9.9/x86_64/4.9.0-9-amd64/cofio/2019-07-12%2013:08:53?short

The whole business with testing an interrupt is really unstable. It seems to work almost all of the time, but having the tests fail in even 1 percent of the tests is not acceptable, is it? (Imagine this being the case for all modules.)

I do not know, where I could possible have made a mistake with catching an interrupt. I suspect that it just sometimes fails at some place that I have no impact on.

Anyway, maybe I should remove those fragile tests (in a new ticket).

@kliem

This comment has been minimized.

@kliem
Copy link
Contributor Author

kliem commented Jul 12, 2019

Changed dependencies from #26887 to none

@tscrim
Copy link
Collaborator

tscrim commented Jul 24, 2019

comment:16

A few things:

Are you absolutely sure that nobody will (should) be passing the n_lines data to the constructor (unless they know what they are doing)? If not, then you should deprecate that (including having it be in its original position).

#27987 -> :trac:`12987`

if unbounded is False: -> if not unbounded: (unless you expect unbounded to possibly be something else like None that should be treated differently, in which case you should add a comment about that).

@kliem
Copy link
Contributor Author

kliem commented Jul 24, 2019

comment:17

Thanks.

Replying to @tscrim:

A few things:

Are you absolutely sure that nobody will (should) be passing the n_lines data to the constructor (unless they know what they are doing)? If not, then you should deprecate that (including having it be in its original position).

CombinatorialPolyhedron has not been in the master branch yet. So I figured it is ok. I can throw a warning, when unbounded is an integer, to make sure no one accidentally uses it.

At the moment, I'm forcing the user to use the Vrepresentation as in Polyhedron w.r. to the lines in the representation.
Maybe this is to restrictive and I should allow the user to just pass the dimension of the affine space contained in the polyhedron instead (raising the dimension by that number).

#27987 -> :trac:`12987`

if unbounded is False: -> if not unbounded: (unless you expect unbounded to possibly be something else like None that should be treated differently, in which case you should add a comment about that).

@tscrim
Copy link
Collaborator

tscrim commented Jul 24, 2019

comment:18

Replying to @kliem:

Thanks.

Replying to @tscrim:

A few things:

Are you absolutely sure that nobody will (should) be passing the n_lines data to the constructor (unless they know what they are doing)? If not, then you should deprecate that (including having it be in its original position).

CombinatorialPolyhedron has not been in the master branch yet. So I figured it is ok. I can throw a warning, when unbounded is an integer, to make sure no one accidentally uses it.

Okay, then this is good as it currently is (i.e., you do not need to issue a warning).

At the moment, I'm forcing the user to use the Vrepresentation as in Polyhedron w.r. to the lines in the representation.
Maybe this is to restrictive and I should allow the user to just pass the dimension of the affine space contained in the polyhedron instead (raising the dimension by that number).

That is probably best for another ticket.

So if you make the other two changes I mentioned, then you can set a positive review on my behalf.

@tscrim
Copy link
Collaborator

tscrim commented Jul 24, 2019

Reviewer: Travis Scrimshaw

@kliem
Copy link
Contributor Author

kliem commented Jul 24, 2019

comment:19

Great. I will do so probably on Saturday (no PC at the moment).

Replying to @tscrim:

Replying to @kliem:

Thanks.

Replying to @tscrim:

A few things:

Are you absolutely sure that nobody will (should) be passing the n_lines data to the constructor (unless they know what they are doing)? If not, then you should deprecate that (including having it be in its original position).

CombinatorialPolyhedron has not been in the master branch yet. So I figured it is ok. I can throw a warning, when unbounded is an integer, to make sure no one accidentally uses it.

Okay, then this is good as it currently is (i.e., you do not need to issue a warning).

At the moment, I'm forcing the user to use the Vrepresentation as in Polyhedron w.r. to the lines in the representation.
Maybe this is to restrictive and I should allow the user to just pass the dimension of the affine space contained in the polyhedron instead (raising the dimension by that number).

That is probably best for another ticket.

So if you make the other two changes I mentioned, then you can set a positive review on my behalf.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 27, 2019

Changed commit from 14d17a8 to 806a217

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 27, 2019

Branch pushed to git repo; I updated commit sha1. New commits:

806a217correct link to trac ticket, if unbounded is False -> if not unbounded

@kliem
Copy link
Contributor Author

kliem commented Jul 27, 2019

comment:21

Two changes mentioned by Travis taken care of.

@vbraun
Copy link
Member

vbraun commented Jul 29, 2019

Changed branch from public/27987-new to 806a217

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants